Link to home
Start Free TrialLog in
Avatar of anithas
anithas

asked on

Increasing the button size of showConfirmDialog and showMessageDialog

hi,
 How to increase the size of YES_NO Button and OK Button of showConfirmDialog and showMessageDialog respectively.  Now it seems to be very small width and height when we view through 1024 resolution screen.

Regards

Anitha S
Avatar of zzynx
zzynx
Flag of Belgium image

Set "____Yes____" and "____No____" on that buttons  (with _ being a blank)
That's for the width of course
I mean

          Object[] options = { "       Yes        ", "       No       " };
          JOptionPane.showOptionDialog(null, "Are you sure to .... ?", "Title",
                 JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
                 null, options, options[0]);
>> Now it seems to be very small width and height when we view through 1024 resolution screen.
I think it will follow the system's look and feel. So, not sure if it's a good idea to change that.
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sciuriware
sciuriware

You can also get what you want by:

   Font buttonFont = new Font("Ms Sans Serif", Font.BOLD, 12);

               UIManager.put("Button.font", buttonFont);

Then ALL buttons get the new font; you can choose another or bigger font if you like.

;JOOP!
Please split.
;JOOP!
Sorry sciuriware, but I really think my last comment is the solution.
(S)he asked for an increase of the button sizes. (S)he didn't told (s)he wants the font to be bigger.
mmmmmmmmmmmmmmm
Thank you