screen resolution
2 posts in topic
Flat View  Flat View

Posted By:   venkata_surreddy
Posted On:   Monday, June 2, 2003 09:22 PM

hello sir,
i want to know how to fit the window screenful when we
run applet or frames i.e we specify the window size using
setSize() method but i want to set the window screenful

Re: screen resolution

Posted By:   srikanth_medasani  
Posted On:   Thursday, June 19, 2003 04:20 AM

we can set the screen size as per the size of the window.

Toolkit tk=Toolkit.getDefaultToolkit();

Dimension d=tk.getScreenSize ();

setSize(d.width, d.height); will set the size same as window size.

setSize(d.width/2, d.height/2); will have half of the size of window size.

one can set the location of the fame on the window by using

setLocation(d.width/3, d.height/3);

use different combinations while dividing and check them.

hope this will help you,


Srikanth Medasani

Re: screen resolution

Posted By:   Stephen_McConnell  
Posted On:   Tuesday, June 3, 2003 05:21 AM

You can use the AWT class Toolkit to get this information. This has to be done on the client side, probably in the
method of the Applet.

// Get the default toolkit for the client.
java.awt.Toolkit tk = java.awt.Toolkit.getDefaultTookkit();
// Get the screen size.
java.awt.Dimension dim = tk.getScreenSize();

Take a look at the abstract class Toolkit. It has all kinds of info available in it. There is also a new class from SDK 1.3 or 1.4 that does what Toolkit does, but I haven't done any Client side programming in a couple of years.

Stephen McConnell

About | Sitemap | Contact