I'm new to Java Swing. I created the simple window.
public class Main {
public static void main(String[] args) throws Exception{
EventQueue.invokeLater(() -> {
var frame = new JFrame("My window");
frame.setSize(300, 200);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setVisible(true);
});
}
}
Every time I run my app the screen on my mac blinks and becomes black for a half of the second. Then window appears.
Did I forget something to add to avoid this or something is wrong with my mac?