This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Size of JFrame and JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Size of JFrame and JPanel" Watch "Size of JFrame and JPanel" New topic

Size of JFrame and JPanel

Juhan Voolaid
Ranch Hand

Joined: Nov 18, 2003
Posts: 179

I have Jframe that has a borderlayout. In south there is small jpanel with some information text and in center is big JPanel where the game is running.

Proble is that i want the JPanel in center to have size of lets say 800*600 and JFrame would set its size automatically, so that the 2 JPanels fit perfectly. And JFrame will not have any extra space anywhere.

I don't know how to do that.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Try this (I've used North/Center instead of Center/South)

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Size of JFrame and JPanel
Similar Threads
JTree resizing issue
Fixed drawing area
jpanel position
Problem with JTree inside JScrollPane inside JPanel
How to size jsplitpane?