Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to invoke a JInternal Frame from a button?

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

------------------
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Not so fast naughty spawn! I want you to know about
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic