What methods are called when the JFrame is resized?

I use a JFrame in which the CENTER BorderLayout part is occupied by the JScrollPane, which wraps around the JPanel. I find that when I initiate an action that actually causes the JPanel to display, the display does not change. But when I resize the JFrame, a new JScrollPane now appears.

So, what methods are called when the JFrame is resized? If I know, then I can call it in the code and avoid the need to resize the frame just to see the results of the operation.

+4
source share
1 answer

There was not much of it, since I made a swing, but from memory, calling the validate () function on the panel should do the trick. This will cause him and his children to be calculated according to their layout when the scroll decision is made. If this does not work, try checking in the frame contents pane. This is slightly more expensive, but may be required if other components are considered.

+4
source

All Articles