JFrame positioning in the center of the window on MAC OSX
Any body please can help me how to focus on JFrame
on Mac. OS X?
I tried:
this.setLocationRelativeto(null);
this.setLocationRelativeto(this);
this.setLocationRelativeto(getRootPane());
.. and
final Toolkit toolkit = Toolkit.getDefaultToolkit();
final Dimension screenSize = toolkit.getScreenSize();
final int x = (screenSize.width - this.getWidth()) / 2;
final int y = (screenSize.height - this.getHeight()) / 2;
this.setLocation(x, y);
None of this was done, my frame is still at the bottom and hidden behind the Mac dock.
+3
source to share