Setting the size of a ContentPane (inside of a JFrame)

Posted by Jim on Stack Overflow See other posts from Stack Overflow or by Jim
Published on 2010-05-09T06:01:19Z Indexed on 2010/05/09 6:08 UTC
Read the original article Hit count: 159

Filed under:

Hello,

I want to set the size of a JFrame such that the contentPane is the desired size. JFrame.setSize() doesn't take the window decorations into account, so the contentPane is slightly too small. The size of the window decorations are platform and theme specific, so it's bad news to try to manually account for them.

JFrame.getContentPane().setSize() fails because it's managed.

Ideas?

Thanks!

© Stack Overflow or respective owner

Related posts about swing