File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Window Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Window Size" Watch "Window Size" New topic
Author

Window Size

Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
Any advice on how big to make the main window? I have a big monitor and I'm not sure how my application will look on another monitor when I use the following code:

dbFrame.setSize(900, 650);

Thanks all.
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Anthony:
It is better design to first retrieve the client resolution, then construct your frame according to this resolution. For example you might want to make your frame half of the size of the screen width and height.


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Andy Zhu
Ranch Hand

Joined: May 26, 2004
Posts: 145
Hey, Hanna: how to retrieve client's screen info? Thanks.


--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
you can use:

Dimension screenSize = getToolkit().getScreenSize();

then you can retrieve getWidth() and getHeight() of the Dimesion object.
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
Thanks Hannah. I'll follow your advice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Window Size