wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Spring Layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Spring Layout" Watch "Spring Layout" New topic

Spring Layout

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622

I went through the java tutorials. I am having difficulty in understanding SpringLayout's putConstraints().

Following code adds a LABEL.

I am not getting the 4th argument passed in putConstraints().

What is understood is that in the 1st putConstraints(), position the label from west side of the container leaving 10 units(i guess pixels). 5th arg states to put in contentPane.

Similarly second putConstraints() does the same work but beginning from North, leaving 25 units in y axis.

But what does fourth argument does? SpringLayout class says that's an edge of the anchor.

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Doubts cleared.

I agree. Here's the link: http://aspose.com/file-tools
subject: Spring Layout
Similar Threads
Can someone please help
My .PNG background will not export ||THIS HAS BEEN RESOLVED!!! THANKS!!||
Help with artifact
SpringLayout Question - (code snipet inside)
JLabel and JTextArea do not show properly in ubuntu