Maximize: JFrame setExtendedState

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.