We help IT Professionals succeed at work.

How do I bring up a minimized JFrame programatically in Java

gdkinney_2
gdkinney_2 asked
on
Medium Priority
307 Views
Last Modified: 2013-12-29
How do I bring up a minimized JFrame programatically in Java?  If a user attempts to access a JFrame that has been created but minimized how do you bring up the JFrame programatically?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
setState and setExtendedState I think.
The JFrame will directly go to the taskbar.
When clicked there it will display in the left upper corner of the screen
at the size you set in the code.
If you want it to display in the center of the screen, add

            f.setLocationRelativeTo(null);
to the build-up code.

;JOOP!
      JFrame f = new JFrame();
      
      // Set layout and add components.
      // Set the normal size of the frame when displayed.
      
      f.setExtendedState(Frame.ICONIFIED);
      f.setVisible(true);

Open in new window

CERTIFIED EXPERT

Commented:
?
!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.