Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie JFrame setSize() question  RSS feed

 
Scott Matthews
Ranch Hand
Posts: 36
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did the trick.
Thank you.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!