Hi all--
I was wondering is there a way to get what the size of the contentPane for a JFrame will be BEFORE setting it visible?
For instance,
import javax.swing.*;
import java.awt.*;
public class MyFrame extends JFrame{
public MyFrame(){
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(new Dimension(1024,768));
System.out.println("ContentPane size before vis= "+this.getContentPane().getSize());//prints 0,0
this.setVisible(true);
System.out.println("ContentPane size after vis= "+this.getContentPane().getSize());//prints 1016,741
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new MyFrame();
}
});
}
}
How can I get the fact that it WILL be 1016,741 prior to it actually being set visible?
Thanks!
Message was edited by:
mr.v.