Advertisement Jump to content


This topic is now archived and is closed to further replies.


[java] setting client area

This topic is 5347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Having trouble with swing/awt and window sizes... I want to set the *client area* of my window (a JFrame) to a certain size, but it seems swing takes the sizes literally and sizes the whole window to the given size, and part of the client area is taken up by borders and title bar. how can I account for this? i've been scanning the javadocs for a while now, i can't seem to fine any method to calculate what size i need to give it if i want a client area so and so big? all help is appreciated. [edited by - Rocket05 on May 30, 2004 2:42:10 PM]

Share this post

Link to post
Share on other sites
Just make a JPanel, that is the size you want, using setPreferredSize(). Then add that to the JFrames content pane, pack, and show. I believe that should help. o_O

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!