File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to make a Jframe from minimum to maximum ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make a Jframe from minimum to maximum ?" Watch "How to make a Jframe from minimum to maximum ?" New topic

How to make a Jframe from minimum to maximum ?

Tom John

Joined: Apr 15, 2002
Posts: 29
My environment is win2000+java1.2
Now I have build two Swing Jframe : frame1 and frame2. The frame1 is current shown in the screen . The other Jframe , frame2, is minimized . I want to when I click a button in the frame1, the frame2 can maximize and be shown in the current screen .
But I don’t know how to do this ? I have try to use the method requestFocus() to deal with it , but it can not work correctly . Who can tell me how to do this ? Please tell me in every detail. ThanX!
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Perhaps you could try dispose() method instead to hide any frame at any given time...or perhaps the better way is to use JInternalFrames..never tried it but perhpas this could work..
All the best....
Renee Zhang
Ranch Hand

Joined: Sep 10, 2001
Posts: 72
I did something that jumps between 2 JFrames before.
1. pass frame2 to the frame1.
2. when the button is pressed, if frame2 is minimized, then call if (frame2.getState() == JFrame.ICONIFIED) frame2.setState(JFrame.NORMAL); then you can max the size by yourself. If frame2 is showing behind the frame1, then call to bring it the sceen.
Good luck!
I agree. Here's the link:
subject: How to make a Jframe from minimum to maximum ?
It's not a secret anymore!