The moose likes Beginning Java and the fly likes calculate current window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "calculate current window" Watch "calculate current window" New topic

calculate current window

alaina peeler

Joined: Dec 04, 2005
Posts: 29
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

Joined: May 25, 2001
Posts: 388
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

marc weber

Joined: Aug 31, 2004
Posts: 11343

If you're looking for screen size, try...

Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: calculate current window
jQuery in Action, 3rd edition