Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame full screen  RSS feed

 
Jose Parrilla
Greenhorn
Posts: 5
Java Python Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i make my JFrame window full screen when I run the program instead of having to click on the full screen button every time I run the program and the window pops up?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out Frame#setExtendedState(MAXIMIZED_BOTH);
 
george georgakakos
Greenhorn
Posts: 18
2
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you may try the following on a JFrame object on your main function

JFrame ts = new JFrame();
ts.setLocationRelativeTo(null);
ts.setExtendedState(JFrame.MAXIMIZED_BOTH);
ts.setVisible(true);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!