Hi all,
I have a JOptionPane with a YES button and a NO button. All I want to do is be able to press the left or right button on the keyboard to change the focus on the buttons. By using the mouse it works. Is there some kind of Listener I can use?
Here is my code :
int response = JOptionPane.showConfirmDialog(null,"Are you sure you want to exit","Exit?",
JOptionPane.YES_NO_OPTION,JOptionPane.PLAIN_MESSAGE);
if(response == JOptionPane.YES_OPTION){
System.exit(1);
}else {
//do nothing
}