Java; Getting the insert in front of the frame

Assuming a normal JFrame, I try to get the insertion values ​​before the frame becomes visible. I can get these penalty values ​​when the frame becomes visible (and I suppose I could create a jframe off-screen), but wondered if there was a way to tickle Java in setting the insert before visibility. Prior to this call, all insertion values ​​are zero.

Net, I'm trying to get the exact dimensions of the client area of ​​the frames - or better said, I'm trying to create a JFrame with very specific dimensions of the client area.

Thanks in advance.

+6
java swing jframe
source share
1 answer

Did it help?

frame.pack(); System.out.println("Frame Insets : " + frame.getInsets() ); 

I am trying to create a JFrame that has very specific client area sizes.

Then you set the preferred size of the panel added to the frame:

 panel.setPreferredSize( new Dimension(...) ); frame.add( panel ); frame.setResizable( false ); frame.pack(); frame.setVisible(true); 
+12
source share

All Articles