Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame full screen

 
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: 17
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);
 
Your mother was a hamster and your father was a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!