swing - Show confirm dialog in java -
here's actionperformed code logout button :
private void jbutton5actionperformed(java.awt.event.actionevent evt) { joptionpane jop = new joptionpane(); int option = jop.showconfirmdialog(null, "voulez-vous vraiment vous déconnecter?", "déconnexion", joptionpane.yes_no_option,joptionpane.question_message); if(option == joptionpane.ok_option){ this.dispose(); connexion connexion = new connexion(); connexion.setvisible(true); } }
once click right on button, application stops running how can handle this?
here's rest of code button
jbutton5.seticon(new javax.swing.imageicon(getclass().getresource("/sinpec/deco.png"))); jbutton5.setborderpainted(false); jbutton5.setcontentareafilled(false); jbutton5.setrollovericon(new javax.swing.imageicon(getclass().getresource("/sinpec/deco1.png"))); // noi18n jbutton5.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jbutton5actionperformed(evt); } }); jpanel1.add(jbutton5); jbutton5.setbounds(70, 0, 50, 50);
this.dispose(); connexion connexion = new connexion(); connexion.setvisible(true);
change order?
connexion connexion = new connexion(); connexion.setvisible(true); this.dispose();
Comments
Post a Comment