dimanche 16 octobre 2016

How do I printout multiple text in JText Field using if/else statement?

    private void resultActionPerformed(java.awt.event.ActionEvent evt) {                                       
    // TODO add your handling code here:
    if(pick1 > pick2 ){
    resultstf.setText("The New President is Koon!");
    }
    else if(pick2 > pick1){
    resultstf.setText("The New President is Baam!");
    }
    else if(pick1 == pick2){
    resultstf.setText("The Result for the new President is a Tie! Please Vote Again.");
    }
    if(pick3 > pick4){
    resultstf.setText("The New VP is Sachi!");
    }
    else if(pick4 > pick3){
    resultstf.setText("The New VP is Faker!");
    }
}

How do I print out multiple Text whenever I press the Result Button? Like I want to print out "The New President is Koon" and also printout "The New VP is Sachi" at the same time.

Aucun commentaire:

Enregistrer un commentaire