- Sep 30, 2001
- 12,684
- 2
- 81
What is the easiet way to resize all my Components when my JFrame has been resized. Say for instance, the user hits the maximize button and the window maximizes.
I set up a listener for my JFrame getting resized and inside the function I attempt to resize the components I need to scale to the new size.
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent evt) {
formComponentResized(evt);
}
});
jSplitPaneMain.setSize((int)mainPanel.getSize().getWidth(),(int)mainPanel.getSize().getHeight()-100);
is my resize call...but it doesn't change the size of the JSplitPane...what am I doing wrong? Or is there an easier way to do this?
I set up a listener for my JFrame getting resized and inside the function I attempt to resize the components I need to scale to the new size.
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent evt) {
formComponentResized(evt);
}
});
jSplitPaneMain.setSize((int)mainPanel.getSize().getWidth(),(int)mainPanel.getSize().getHeight()-100);
is my resize call...but it doesn't change the size of the JSplitPane...what am I doing wrong? Or is there an easier way to do this?