When the user resizes the JFrame in my program, i want to determine the new location for some components in that JFrame to fit the new size.
Well, it works fine the first time the user resized the JFrame, it works correctly. However, the second time they resized the JFrame, seems like all the components get back to the original coordinates again (before my 1st resize) so my 2nd resize becomes inaccurate.
Here's a sample of the code :
Am i doing something wrong here ? [ August 27, 2008: Message edited by: Bear Bibeault ]
There are all sorts available, which you can find out from the Java Tutorials. If you want to use GridBag, there is a very useful utility class here, and a slightly less useful utility here .
Actually i was already using a layout, i just didn't know how to force it to resize the components automatically when resizing or maximizing the window. Now i've got it ... Thanks a lot.