• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie JFrame setSize() question

 
Scott Matthews
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did the trick.
Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic