public class Excluir extends javax.swing.JDialog {
/** Creates new form Excluir */
public Excluir(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jOptionPane = new javax.swing.JOptionPane();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jOptionPane.setIcon(new javax.swing.ImageIcon(getClass().getResource("/metal-Warn.gif")));
jOptionPane.setMessage("Você tem certeza que deseja excluir!");
jOptionPane.setOptions(options);
getContentPane().add(jOptionPane, java.awt.BorderLayout.CENTER);
pack();
}
/**
* @param args the command line arguments
*/
/* public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Excluir(new javax.swing.JFrame(), true).setVisible(true);
}
});
}*/
// Variables declaration - do not modify
public javax.swing.JOptionPane jOptionPane;
// End of variables declaration
Object[] options = {"Sim", "Não"};
}
E gostaria q qdo fosse clicado no sim o JDialog fosse fechado alguém tem alguma dica!