Refreshing Components

I have 2 split panes, one horizontal and the other vertical. The bottom component has a JTable. The top-left and right panes have a panel with an image.

Now, when I resize the main frame of the application, it partially hides the JTable as well as the components in the split pane.

How can I detect the window resizing behaviour and also resize the components within the splitpanes so that they are not partially hidden? Thanks in advance.

[459 byte] By [balachandrana] at [2007-10-2 20:14:37]
# 1

You should not need to do that. If you are using appropriate layouts, it should be done for you. This is true of normal components, including the table.

However, for images you have to determine what you intend to happen. Do you want the images to shrink and stretch or do you want scrollbars?

BaltimoreJohna at 2007-7-13 22:56:47 > top of Java-index,Desktop,Core GUI APIs...
# 2

I am using ScalableImageIcon utility class to resize the images when the size changes.

So, if I use the right layout manager then the components will automatically re-arrange to fit the size of the new window?

I was under the impression that I may have to do invalidate(), revalidate() or something to that effect to force the refresh.

balachandrana at 2007-7-13 22:56:47 > top of Java-index,Desktop,Core GUI APIs...
# 3
Nope. It is all automatic. The validate methods are used when components are added or removed.
BaltimoreJohna at 2007-7-13 22:56:47 > top of Java-index,Desktop,Core GUI APIs...