Polli
December 21, 2020, 6:51am
4
Read this too late …
… but there was already great Java software (at least 150 and including Ancestris):
… and Ancestris11 (nightly version) works from the original package for Linux (but also MacOS) with a double click!
Thanks to Korli for reworking OpenJDK (V8 + now V11 are optimal for Ancestris)!
There remains (among other things) this old (known) error:
opened 12:55PM - 29 Sep 19 UTC
type-bug
Hello.
Haiku - R1/Beta1
JVM - openjdk 12.0.1+12
Code:
```java
import … javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class WindowTest
{
public static void main(String[] args)
{
SwingUtilities.invokeLater(WindowTest::show);
}
private static void show()
{
JFrame f = new JFrame();
f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
f.setSize(500, 500);
f.setTitle("Test");
f.addWindowListener(new WindowAdapter()
{
@Override
public void windowOpened(WindowEvent e)
{
System.out.println(f.getLocation());
System.out.println(f.getLocationOnScreen());
System.out.println(f.getGraphicsConfiguration().getDevice().getIDstring());
}
});
JMenuBar bar = new JMenuBar();
JMenu c = new JMenu();
c.add(new JMenuItem("Open"));
c.setText("File");
c.setMnemonic('F');
bar.add(c);
f.setJMenuBar(bar);
JPanel panel = new JPanel();
panel.add(new JLabel("Test Some Label"));
panel.add(new JLabel("<html><body><b>Test Some Label</b></body></html>"));
f.setContentPane(panel);
f.setVisible(true);
}
}
```
Sometimes - jvm show dialog outside visible area. Few screenshots:
*Title bar is outside visible area*
![](https://klikr.org/0a78128cbad21b552448cd4e21da.png)
*Almost full window outside visible area*
![](https://klikr.org/40e5e7ace8b61aa832415c75f0c4.png)
*In most cases it return valid x=0, y=0*
![](https://klikr.org/9c9f047982a284c254ca5772d9d6.png)
Thanks