i have developed a window using Swing package which consists of mainpanel(JPanel). this mainpanel is added to the JFrame and again mainpanel contains multiple number of JPanels. i used componentListener to find if window is resized and set the new sizes to all the panels. if i resize the window it is working fine, but when i directly maximize the window the components inside the mainpanel are not getting resized instantly. what is the listener to find if window is maximized.
Asked
Active
Viewed 308 times
0
-
13_set the new sizes to all the panels_ sounds like manual sizing/positioning? If so, that's _wrong_ in a typical swing context - let a suitable LayoutManager handle it. – kleopatra Dec 24 '12 at 12:18
-
6Use an appropriate a your manager. Check out [Using Layout Managers](http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html) and [A Visual Guide to Layout Managers](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html) – MadProgrammer Dec 24 '12 at 12:19
-
3have look at ComponentListener for this job, but usage of Standard LayoutMangers is better of ways – mKorbel Dec 24 '12 at 13:46