• Post Reply Bookmark Topic Watch Topic
  • New Topic

2 probs. -> maximize window / dialog tasklist  RSS feed

 
Matthias Mosimann
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone

I've got a little an a strange problem. The first Question I have is very simple I think but I didn't find out how to figure that in Java. I'm very new to Java and perhaps someone could help me.
1) How can I set the Window maximazed when my java application starts? If I use
Dimension dm = Toolkit.getDefaultToolkit().getScreenSize();
and get the height and the width and then set the Size with this values, the screen will be under the tasklist (only the last 40 px of the frame). Sure I could subract ca. 40 px of the height, but I think there must be a better solution. How can I set the size of the window exactly (so the frame doesn't disappear under the tasklist)? Is there anyone who has a better solution?
2) I have a class extended from JDialog. If I run the application under windows and open the dialog there will be no entry in the tasklist. But under linux there is an entry in the tasklist for the dialog. Is somebody able to explain me why this is different in windows? I use JBuilder from Borland as IDE (on both system: windows and linux) and in JBuilder the Info Screen under "Help" -> "Info" appears on both systems (windows and linux) without an entry in the tasklist. Why then my application make an extra entry in the taskliste under linux? Strange isn't it? Or could somebody give me tipp how can I create such a frame which makes no entry in the tasklist?

Thank you for all postings and I hope everyone is able to read my poor English and will understand my problems.
regards,
Matthias
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.) If you're using anything newer than 1.4.0 you can use the setExtendedState( JFrame.MAXIMIZED_BOTH ) method. This is the same as pressing the maximize button on the title bar of the frame. On windows the frame takes into consideration the size of the taskbar and resizes accordingly if you change the size of the taskbar. One thing to note - this method only works if the frame has already been realized. (i.e. had either .setVisible() or .pack() called on it.)

2.) Unfortunately I don't have a Linux box at work, so I won't be able to test this out right now...
 
Matthias Mosimann
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nate

First of all thank you for your post!
To problem 2: Do you know another possibility to create a frame/dialog which gives no entry in the tasklist?

regards,
Matthias
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!