Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculate current window

 
alaina peeler
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to find the deminsions of half of my current window so i can write my methods for my program.....please help...
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you try and read the API doc of the window (perhaps its JFrame or so) ?
there is probably something like getDimension(), getWidth()/getHeight(), getSize().
and if you find the size... your halfway there :-)
API Docs


K
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're looking for screen size, try...

Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic