File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Internationalize JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Internationalize JOptionPane" Watch "Internationalize JOptionPane" New topic

Internationalize JOptionPane

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 309
Please tell me how to internationalize the buttons in JoptionPane.

Thanks for your help,

Alejandro Barrero

Your help will be greatly appreciated,
Alejandro Barrero
Rob Spoor

Joined: Oct 27, 2005
Posts: 19653

Check out this method:
public static int showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue) throws HeadlessException

With this method, you can specify just about everything for your option dialog. It will create a button for each element in "options", with the button for "initialValue" being the default button. If you use Strings you will be fine.

How To Ask Questions How To Answer Questions
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Even quicker...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
wood burning stoves
subject: Internationalize JOptionPane
Similar Threads
[B]How To Center/Position a showMessageDialog box?[/B]
Message Dialog box --> action performed.
java alert
To authors
actions performed