aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to invoke a JInternal Frame from a button? 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 invoke a JInternal Frame from a button?" Watch "How to invoke a JInternal Frame from a button?" New topic
Author

How to invoke a JInternal Frame from a button?

Arun Martin
Ranch Hand

Joined: Dec 01, 2000
Posts: 64
Hi,
I have got a pblm. I have designed a menu. On clicking a menuitem, a JInternal Frame is displayed. Inside that JInternalFrame, couple of buttons are displayed. On clicking a particular button, the existing JInternalFrame should vanish and in it's place, the java pgm defined in the actionPerformed of that Button should appear as another JInternalFrame.
Arun Martin.

------------------
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
Have you set up the button on the internalframe to close that internal frame? If you haven't, you need to. check out the dispose() method in JFrame. Once that structure is in place,use the getX() and getY() to find the origin position of your dying internalframe before you dispose of it. Then call your new Internalframe. Once it exists, you can use either setX/setY or you might use reshape. This should get you about where you want to be I think.
Arun Martin
Ranch Hand

Joined: Dec 01, 2000
Posts: 64
Hi Chris,
Thanks for your valuable suggestion. The main pblm was that I was trying a JInternalFrame from another JInternalFrame.
I added JInternalFrame to a Desktop Pane and the solution was obtained.
Thanks once again for the valuable guidelines.
bye
Arun.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to invoke a JInternal Frame from a button?