How can I get Screen Desktop size.
I can get Screen size using DefaultToolkit.getScreenSize()
but, How can I get Desktop size which is the Screen size without taskbar height(usually on the bottom showing start button and trays..in window platform) in the window platform?
I know this thread seems to have been unread in a long while, but I had a question... The given code works brilliantly for windows, but the panel used in Linux is not identified by this code... The screen size and max bounds returned are identical...
I using a different way to get desctop size. I do not try it on Linux, but on Windows it works well. Try the folowing:
int maxHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0].getDisplayMode().getHeight();
int maxWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0].getDisplayMode().getWidth();
Because of it is possible to have more then one graphic device, you have array as result of getScreenDevices(). For me it is works well to use allways a first one. You can implement you own logic.