swingjoptionpaneshortcuthotkeysjide

Need Shortcut keys for JOption(javax.swing) /Jidesoft(com.jidesoft.dialog) Error dialog


I am Using following code,

StringBuffer sb1 = new StringBuffer("<html>Map Following data:\n WTXFF,WTXF");
    JScrollPane scrollPane = new JScrollPane(new JLabel(sb1.toString())); Object[] options = new Object[] {"ShowMappingTable" , "Cancel", };
        int answer = JOptionPane.showOptionDialog(getWindow(), scrollPane, "Error ", JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, options, null);

enter image description here

How can I add Hot keys to the ShowMappingTable and Cancel button. I greatly appreciate your help. Thanks


Solution

  • I think you have to make a completely custom dialog to be able to assign your own accelerators. Unfortunately that usually requires much more coding. Check Oracle's tutorial for the best alternative for you.