aspose file tools*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Internationalize JOptionPane" Watch "Internationalize JOptionPane" New topic
Author

Internationalize JOptionPane

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 311
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
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Even quicker...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internationalize JOptionPane