samedi 29 octobre 2016

How can I run an if statement in the answer of a jOptionPane?

So what i'm trying is to do a specific task from the answer of the two options, here's some of the code, but i don't know what's going on here.

String[] sex = { boy, girl };
        JOptionPane.showOptionDialog(null,"Hey " +output1 +". Are  you a boy or a girl?", "Question",
        JOptionPane.YES_OPTION, JOptionPane.NO_OPTION,
        null, sex, sex[0]);




        if(sex == JOptionPane.YES_OPTION)
        {

Aucun commentaire:

Enregistrer un commentaire