JOptionPane custom options - button mnemonics

From: Stanimir Stamenkov (s7an10_at_netscape.net)
Date: 03/22/05


Date: Tue, 22 Mar 2005 13:13:49 +0100

I've searched the archives but I haven't found anything particular
dealing with this issue.

I want to set mnemonics for the buttons representing custom supplied
options when creating a JOptionPane, like:

     String options = { "Abort", "Continue" };
     JOptionPane.showOptionDialog(parentComponent,
             message, title, JOptionPane.YES_NO_OPTION,
             JOptionPane.WARNING, null, options, options[0]);

I've though of supplying JButton option instances for the options
but then I'm loosing the default button action handling and the
default button look&feel is different from the one seen in a default
JOptionPane.

Is there more convenient way than supplying custom buttons as
options to achieve setting mnemonics on the rendered default buttons?

-- 
Stanimir