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

JFrame on Screen Size  RSS feed

 
Qusay Jaafar
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'd like to write a code that makes the JFrame take all the screen size. The code is:
public class FullScreen extends JFrame {
public static void main(String[] args) {
FullScreen fs = new FullScreen();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int width = (int) (d.getWidth());
int height = (int) (d.getHeight());
fs.setSize(width, height);
// of course, some code for visiblity and closing here
}
}
what happens here the JFrame takes all the screen even under the task bar (I am using Windows 2000).
My Question is:
How I write a code making the bottom area above the task bar?
Regards
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JDK 1.4.x you can do:
frame.setExtendedState(JFrame.MAXAMIZE_BOTH);
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can use the new FullScreen mode if you want a non-windowed, fullscreen application...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!