How to get the highest point of the taskbar
I would like to show a JWindow just above taskbar.
How can I get the highest point of the taskbar? Is there a way like System.getProperty("os.taskbarHeight") ?
In MS windows the taskbar has standard height but in KDE the taskbar has variable height (I am not sure about Gnome). Moreover the taskbar sometimes is hidden. How Do I get if it is hidden or not?
Thank you in advance.
[404 byte] By [
nickgika] at [2007-11-26 19:28:24]

# 1
You would use the "Screen Bounds" and "ScreenSize" info to calculate what you want:
import java.awt.*;
import javax.swing.*;
public class FrameInfo
{
public static void main(String[] args)
{
String laf = "javax.swing.plaf.metal.MetalLookAndFeel";
//laf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
//laf = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
try { UIManager.setLookAndFeel( laf ); }
catch (Exception e) { System.out.println(e); }
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle bounds = env.getMaximumWindowBounds();
System.out.println("Screen Bounds: " + bounds );
GraphicsDevice screen = env.getDefaultScreenDevice();
GraphicsConfiguration config = screen.getDefaultConfiguration();
System.out.println("Screen Size : " + config.getBounds());
JFrame frame = new JFrame("Frame Info");
frame.setSize(200, 200);
frame.setVisible( true );
System.out.println("Frame Size: " + frame.getSize() );
System.out.println("Frame Insets : " + frame.getInsets() );
System.out.println("Content Size : " + frame.getContentPane().getSize() );
}
}