Jridi Mohamed
Jridi Mohamed

Reputation: 1

Cannot find variable JOptionPane

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    int a=JoptionPane.showConfirmDialog(null,"Do you really want to close the application","Select",JOptionPane.YES_NO_OPTION);
    if(a==0)
    {
        System.exit(0);
    }

Upvotes: 0

Views: 46

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168845

int a=JoptionPane.show..

Should be:

int a=JOptionPane.show..

Java is case sensitive, and the first 'o' of an option pane is a capital 'O'.

Upvotes: 1

Related Questions