Answers for "how to ask for confirm on joptionpane"

1

joptionpane.showconfirmdialog yes no example

int answer = JOptionPane.showConfirmDialog(parentComponent, 
		"Your message goes here", "Your title goes here", 
        JOptionPane.YES_NO_OPTION);

if (answer == JOptionPane.NO_OPTION) {
	// do something
} else if(answer == JOptionPane.YES_OPTION) {
  	// do something else
}
Posted by: Guest on May-01-2020
-1

java confirmation dialog

int dialogResult = JOptionPane.showConfirmDialog(frame, "Text", "Title", JOptionPane.YES_NO_OPTION);
if(dialogResult == JOptionPane.YES_OPTION){
  	// Do something
}
Posted by: Guest on August-12-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language