screen size in pixels

I need to have the program retrieve the size of the screen in pixels.Would someone please tell me what method() to useand what class it is in so I can look it up?
[183 byte] By [hillmia] at [2007-11-27 7:57:08]
# 1
Look at: java.awt.Toolkit.getDefaultToolkit().getScreenSize();Message was edited by: petes1234
petes1234a at 2007-7-12 19:38:57 > top of Java-index,Java Essentials,New To Java...
# 2
Thanks, it works. I suppose there is no way to retrieve the size of the bar on the bottom that windows Vista uses to reduce the usable area.
hillmia at 2007-7-12 19:38:57 > top of Java-index,Java Essentials,New To Java...
# 3

This works for Windows XP. It assumes your JFrame is called "frame."

//set window to maximum size but account for taskbar

GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();

Rectangle rect = env.getMaximumWindowBounds();

int width = Double.valueOf(rect.getWidth()-1.0).intValue();

int height = Double.valueOf(rect.getHeight()-1.0).intValue();

frame.setMaximizedBounds(new Rectangle(0,0,width, height));

Jstatsa at 2007-7-12 19:38:57 > top of Java-index,Java Essentials,New To Java...