Jump to content
  • Advertisement

Archived

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

Rocket05

[java] setting client area

This topic is 5229 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
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!