Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to right align the buttons in JOptionPane?

843806Jun 29 2009 — edited Jun 29 2009
Hi,

I am using JOptionPane in my code.

I want all the default buttons that are created by any of the JOptionPane methods (e.g. JOptionPane.showMessageDialog()) be right aligned. Currently all the buttons are shown center aligned.

Here is the only code that I have to display the dialog:
JOptionPane.showMessageDialog(getInstance(), msg, "Deprecated components", JOptionPane.WARNING_MESSAGE);

Can someone tell me how to achieve this?

Regards,

ParagJ
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2009
Added on Jun 29 2009
1 comment
744 views