This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Newbie JFrame setSize() question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Newbie JFrame setSize() question" Watch "Newbie JFrame setSize() question" New topic
Author

Newbie JFrame setSize() question

Scott Matthews
Ranch Hand

Joined: Jun 28, 2001
Posts: 36
In all the small programs I have written, I have given the JFrame a specific width and height using setSize(w,h).
Question: How can I make the JFrame take up the entire screen?
Thanks.
Durga Penmatsa
Greenhorn

Joined: Aug 14, 2001
Posts: 23
Hi,
You could use :
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(screenSize.width, screenSize.height);
Does that answer the question.
Regards
Durga

Originally posted by Scott Matthews:
In all the small programs I have written, I have given the JFrame a specific width and height using setSize(w,h).
Question: How can I make the JFrame take up the entire screen?
Thanks.

Scott Matthews
Ranch Hand

Joined: Jun 28, 2001
Posts: 36
That did the trick.
Thank you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Newbie JFrame setSize() question