Cancel button « JOptionPane « Java Swing Q&A





1. Question about the cancel button on a standard JOptionPane    stackoverflow.com

So I am working on a program for school, and part of the assignment is to have a bunch of prompts for input pop up. I am using the JOptionPane, which ...

2. help with joption pane cancel button    coderanch.com

I am almost there with this one! The book tells me to use a while loop unless the user clicks the cancel button but does not tell me what what code to enter to end the program if they do hit cancel button. I need to end the program at that point but don't know how. Is this the action listener? ...

4. checking for cancel button push in joptionpane.showinputdialog    forums.oracle.com

I am using the following line to get input from a pop up in my program String name = JOptionPane.showInputDialog("What is your name?"); When the pop up is displayed it shows an ok and cancel button, what can i do to check and see if the cancel button is pressed so that I can break out of that function? Thanks for ...