• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actually found the answer to my own question... Use GraphicsEnvironment!



yields the following output:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic