Results 1 to 6 of 6

Thread: SpringLayout.Constraints class

  1. #1
    Join Date
    Dec 2009
    Posts
    48

    SpringLayout.Constraints class

    Hi All,

    I am learning the advanced java program from two months. The advanced java sounds very complicated than core java programming. Specially the inbuilt class of advanced java are very tough to understand. One of them is 'SpringLayout.Constraints class'. I am not getting the exact use of 'SpringLayout.Constraints class'. Do you know anything about the SpringLayout.Constraints class of java? if yes then please let me aware about it.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: SpringLayout.Constraints class

    Hi friend,

    The 'class SpringLayout.Constraints' of java is basically the subclass of 'java.lang.Object' package. The SpringLayout.Constraints class normaly encloses the 'SpringLayout class'. The constraint object of the SpringLayout.Constraints class stores the constraint and which is used to manage the position and size of the component with the use of 'SpringLayout'. This object is also sued for the manipulation of the edges referred as east, south, north and west by using the 'constraint property'.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: SpringLayout.Constraints class

    Hi,

    Following is the some part of java program code which will demonstrate you the use of SpringLayout.Constraints class:
    Code:
    StringBuilder sb1 = new StringBuilder();
    
    SpringLayout.Constraints constraints = lm1.getConstraints( (Component)comp );
    
    Spring spring1 = constraints.getConstraint( SpringLayout.EAST );
    
    System.out.println( spring1.toString());
    
    ByteArrayOutputStream baos1 = new ByteArrayOutputStream();

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: SpringLayout.Constraints class

    The SpringLayout.Constraints class comprises four constructor in the way to handle the SpringLayout properties, see below:
    • SpringLayout.Constraints(Spring xh, Spring yh, Spring width1, Spring height1)
    • SpringLayout.Constraints()
    • SpringLayout.Constraints(Spring xh, Spring yh)
    • SpringLayout.Constraints(Component cp)

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: SpringLayout.Constraints class

    There are number of methods of SpringLayout.Constraints class and which are useful to manages it's layout behavior:
    1. getHeight()
    2. getWidth()
    3. setX(Spring xb)
    4. setConstraint(String Nameofedge, Spring sb)
    5. setY(Spring yb)
    6. setHeight(Spring height)
    7. getConstraint(String Nameofedge)

  6. #6
    Join Date
    May 2008
    Posts
    2,389

    Re: SpringLayout.Constraints class

    Please refer following code for SpringLayout.Constraints class:
    Code:
    {
    private SpringLayout.Constraints firstRowItemConstrant = null;
    private SpringLayout.Constraints prevRowItemConstrant = null;
    public SpringFormBuilder() 
    {
    this(new JPanel1());
    }
    public SpringFormBuilder(JPanel panel1) 
    {
    this.panel1 = panel1;
    
    }
    }

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. How to use SpringLayout in Java?
    By Samarth in forum Software Development
    Replies: 5
    Last Post: 17-02-2010, 12:58 AM
  3. SQL constraints in Database
    By Laquan in forum Software Development
    Replies: 3
    Last Post: 28-01-2010, 09:10 AM
  4. Concept of the Constraints in SQL
    By Smita.bendal in forum Software Development
    Replies: 4
    Last Post: 30-11-2009, 11:25 AM
  5. Advise for constraints and combining projects
    By IreneL in forum Microsoft Project
    Replies: 2
    Last Post: 07-11-2008, 10:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,272,764.64553 seconds with 17 queries