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.
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.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards