• Post Reply Bookmark Topic Watch Topic
  • New Topic

Size of window ???

 
hasan wasif2k1
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to determine the size of window in Java (i.e whether it is 640*480 or 800*600)so that an application can cover the whole area.
 
Nura Horne
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following puts the dimensions in width and height:
<CODE>
int width, height;
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
width = d.getWidth().getWidth();
height = d.getHeight().getHeight();
</CODE>
NOTE: you will need to import the java.awt package to use this!
Rgds, A
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!