I know I can user componentResized
to listen for when the user resizes a window. This isn't a very nice solution. If I do this and add a resize() method for the children components, it waits until the user finishes the resizing until it calls the resize() method. Is there a way to resize the child elements as the resize happens?
views:
22answers:
1
+1
A:
The listener with componentResized()
is the nice solution. Using listener in swing isn't a bad solution at all.
You can see the solution you want on oracle.com
Colin Hebert
2010-10-12 21:36:55
My problem is, if the user resizes the window from 600px to 800px, the components inside will not resize until the user has finished resizing. It looks damn terrible. I am seeking something that will resize the components with the window.
Glenn Nelson
2010-10-12 21:40:49
usually component are resizing at the same time as the container (see the example given in the answer).
Colin Hebert
2010-10-12 21:42:11
I was adding the listener to my window and not my JPanel, that was my problem.
Glenn Nelson
2010-10-12 21:50:49