• 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 a JInternalFrame show on Button Click

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello..
i have made method of every JInternal Frame.
Now i want when i clicke on button than the JInternalFrame related to that button open...
for this i have done this...
1) add InternalFrame in Desktop Pane in constructor and in method i have made its obj. and its size too.. and in actionPerformed i apply show() method on JInternalFrame.
But it is not working
Kindy help me
Thankz in advance.
 
sandhiya sindhi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kindly some body please help me.
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following code worked ok.
 
sandhiya sindhi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank u very much mir Jose. it is working very fine.
i had mistake of missing parameters in JInternalFrame object.
Thank u very much for helping me.
 
sandhiya sindhi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sir but actionPerformed working only once. when i closes the internalform why it is not opening again by clicking on that button again???
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because that internal frame has been "dispose"d of. When you close an internal frame the default operation is to dispose() of the internal frame. For an internal frame this is like calling setVisible( false ), and setClosed( true ). If you want to show a frame again after this you have to set the frame visible, and add it back to the desktop. So the code example would work if you added the frame to the desktop and set it visible in the actionListener, or if you called setDefaultCloseOperation( JInternalFrame.HIDE_ON_CLOSE ) on the internal frame. This would just call setVisible( false ) on the internal frame and not require you to add it to the desktop again if you wanted to reuse it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic