1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Object[] options = {"Editer","Retour"};
JOptionPane pan = new JOptionPane();
Set forwardKeys = pan.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
Set newForwardKeys = new HashSet(forwardKeys);
newForwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
pan.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,newForwardKeys);
System.out.println("FORWARD KEY : "+pan.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS).toString());
int answer = pan.showOptionDialog(
SwingUtilities.getWindowAncestor(ftf),
"Message",
"Titre",
JOptionPane.YES_NO_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
options,
options[1]); |
Partager