Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic