I learned that to center a component in the center of the screen just use:
frame.setLocationRelativeTo(null);
But how do I display the component on top of the Windows clock regardless of screen size?
In my case my code looks like this:
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel("com.jtattoo.plaf.graphite.GraphiteLookAndFeel");
mainn frame = new mainn();
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
I use the Window Builder from my IDE.