JFrame positioning in the center of the window on MAC OSX
Any body please can help me how to focus on
on Mac. OS X?
this.setLocationRelativeto(null); this.setLocationRelativeto(this); this.setLocationRelativeto(getRootPane());
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.
source to share