Reminder: when you want to maximize while using JFrame and setExtendedState you should call:
frame = new JFrame("Title"); frame.pack(); frame.setVisible(true); frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
I.e. call “setExtendedState” after setVisible.