If I run the program below on Linux with OpenJDK Runtime Environment (IcedTea6 1.6) (suse-0.1.3-x86_64), it tells me:
Size: 1440x900
Offset: 0,25
With Java(TM) SE Runtime Environment (build 1.6.0_15-b03):
Size: 1440x900
Offset: 0,0
Now 0,0 is a bit a problem: if I start to draw in my frame at that offset, it'll disappear behind the window-titlebar.
So my question is: what is the way (the standard in java) to find out where to start drawing in your frame?
Code:import java.awt.*;
import java.awt.geom.Rectangle2D;
public class test4 extends Frame
{
public test4()
{
/* retrieve max window size */
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
GraphicsConfiguration [] gc = gs[0].getConfigurations();
Rectangle r = gc[0].getBounds();
setSize(r.width, r.height);
setVisible(true);
Rectangle useable = getBounds();
System.out.println("Size: " + useable.width + "x" + useable.height);
System.out.println("Offset: " + useable.x + "," + useable.y);
}
public void paint(Graphics g)
{
}
public static void main(String [] args)
{
new test4();
}
}

