• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get actual screen size given that Start menu is present

 
Scott Presley
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've done some searching on google and here at this site but haven't found an answer to this one. I need to position a small tooltip-like JWindow relative to a textfield on the screen. My algorithm needs to place this JWindow so that it's visible regardless of the position of the textfield that it is associated with - so if the textfield appears very near the right hand side of the screen, the JWindow will be positioned so it is completely visible. I've got it working pretty well except when the JWindow is to be positioned near the start menu. I'm using the following call to get the screen size:



Now that call returns my screen dimensions without any regard for where the Start Menu (or the application menu on the Mac) is located. If I'm running at 800x600 - with a 60 pixel wide start menu on the right side of the screen, shouldn't my screen size be 740x600? Is there a way to determine the "real" screen size given the location and width/height of the Start Menu?

Thanks in advance,
Scott
 
Scott Presley
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually found the answer to my own question... Use GraphicsEnvironment!



yields the following output:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!