Im developing a java app with MDI application forms. I have assigned menu items to open two internal child forms. when i click them repetitively they create instances for each click how can i stop this and show the previously instantiated form at the first click.
here is the code for the action listener for the menu item im using,
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
RecognitionForm recForm=new RecognitionForm();
desktopPane.add(recForm);
recForm.setVisible(true);
}