= JDialog =
package com.acme.showcase;
public class dlgAbout extends javax.swing.JDialog {
/**
* Creates new form dlgAbout
*/
public dlgAbout(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setVisible(false); // close current window
}
}
In other window or menu, call dialog to open it:
package com.acme.showcase;
public class frmMain extends javax.swing.JFrame {
//...
private void mnuAboutActionPerformed(java.awt.event.ActionEvent evt) {
dlgAbout dlg = new dlgAbout(this, true);
dlg.setVisible(true);
}
}