Вопрос

Situation: there is Supplier_JinternalFrame in JDesktopPane. A Supplier_button is available for call SetVisible(true) in JDesktopPane to show the Supplier frame. but when i close the Supplier Frame through Dispose(); its hide and never see again after click button again. there is and option to use setshow(); and setHide() instead of setDispose(). but i want to recreate Jinternalframe instead of previous form. here is my Supplier_button code for call the Supplier_JInternalFrame Object.

  private void Suppliers_ButtonActionPerformed(java.awt.event.ActionEvent evt)   {                                                 
    Suppliers_JinternalFrame.setVisible(true);//call the object of frame to show the frame
} 

and in Suppliers_JinternalFrame Close button code

 private void Close_SupMangActionPerformed(java.awt.event.ActionEvent evt) {                                              
   Suppliers.dispose();//To close the frame 
} 

after click supplier_Button again. it never show frame again. Any Idea, what should i do to recall the InternalFrame . Is there Any WindowEvents, i suggestest to create ?

Это было полезно?

Решение

When dispose is called, the JInternalFrame is made invisible, it is also removed from the JDesktopPane (think desktopPane.remove(...))

This means that making the frame visible again has no (visible) effect. You need to add the frame back onto the JDesktopPane

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top