• Advertisement


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

Java Client Area Question

This topic is 5978 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

Alright, I code in C++ with OpenGL, but for my university project, I am basically forced to use Java. Anyways, When I call my JFrame.setSize(width,height) method, it sets the frame to that size, and hence the content pane is smaller than that, so my drawing space is smaller than that. However, I want my drawing space to be width and height and I want the JFrame to go around it and be bigger than it so the contentPane is the size I want. I know this can be done with the Win32 API... I''ve already figured out a way to do it, but it involves quite a bit of hacking and because I don''t know the internals of JFrame, it is monkeying up a bit. This is what I have... I create the JFrame with setSize, then I have to show() it so it creates the contentPane, then I getContentPane() and getSize it, then I setSize() on the JFrame but adding the difference that was subtracted from the contentPane and the original width and height I wanted. Finally I got to call initFrame. So... is there a miracle method in Java to do this for me? Because after I finish doing everything I described above, my frame doesn''t behave normally. Thanks for the help, - Tom Btw... I have looked throughout the JDK Documentation

Share this post

Link to post
Share on other sites

  • Advertisement