Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows task bar/desktop size

Status
Not open for further replies.

wiser

Programmer
Jan 29, 2003
10
GB
Does anyone know if there's a way to detect either:
[ul][li]the size and position of the task bar[/li]
or
[li]the dimensions of the desktop minus the task bar[/li][/ul] in Java on Windows NT/2000/XP?
Using
Code:
java.awt.Toolkit.getDefaultToolkit().getScreenSize()
I can get the screen dimensions, but this doesn't take the task bar dimensions into account, so that if I create a window using these dimensions it covers the task bar (which I find annoying, so I'm sure end users will too). I can't assume the task bar will always be in the same place as my program will be used by several users on different PCs.

I couldn't find any way to "maximise" a window either;
Code:
Frame.NORMAL
and
Code:
Frame.ICONIFIED
seem to be the only frame state constants available in
Code:
java.awt.Frame
. Any other ideas?

Thanks.
 
As far as maximizing a window goes, if you use a JFrame you get a maximize button, and in JDK 1.4, you can set the JFrame state to maximized and override the system-supplied maximum bounds.

However, because java is "cross platform" there isn't any way to account for the size or position of the windows task bar. I haven't found a third party product to fill this gap yet...


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top