[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

How do I bring up a minimized JFrame programatically in Java

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?
0
gdkinney_2
Asked:
gdkinney_2
  • 2
  • 2
1 Solution
 
krakatoaCommented:
setState and setExtendedState I think.
0
 
sciuriwareCommented:
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

0
 
krakatoaCommented:
?
0
 
sciuriwareCommented:
!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now