Window1 is JInternalFrame
I want when the menu item is clicked, the JInternalFrame only can show one window, if we click the menu item again, i will detect that JInternalFrame is exist, how to do that?
Here is my code :
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: Window1 frm1 = new Window1(); if (frm1.isShowing()) { JOptionPane.showMessageDialog(null, "yo"); } else { desktopPane.add(frm1); frm1.show(); } }
it still showing new Window everytime i click the menu item