Category: swing

Overriding Swing components labels

Posted by – April 17, 2008

Are you worried about how can you put some components like JOptionPane, JFileChooser or JColorChooser in your language? You can solve this issue easily! Just add this code at the start of your application:

1
    UIManager.getDefaults().addResourceBundle("com.company.YourBundle");

“com.company.YourBundle” is the basename of your properties file, that can be:

YourBundle.properties
YourBundle_en_US.properties
YourBundle_pt_BR.properties

Where YourBundle*.properties may contains:

FileChooser.openDialogTitleText=Abrir
FileChooser.saveDialogTitleText=Salvar
FileChooser.lookInLabelText=Examinar:
FileChooser.saveInLabelText=Salvar em:

OptionPane.yesButtonText=Sim
OptionPane.noButtonText=N\u00E3o
OptionPane.cancelButtonText=Cancelar

ColorChooser.rgbNameText=RGB
ColorChooser.rgbRedText=Vermelho
ColorChooser.sampleText=Texto de Exemplo Texto de Exemplo
ColorChooser.swatchesNameText=Paleta de cores
ColorChooser.swatchesRecentText=Recente:

Share

Some goodies for Java Swing applications

Posted by – December 16, 2007

I found some interesting stuff recently on a search at java.net portal, both related to swing development, one of then is balloontip (balloontip.dev.java.net), this project provides a swing component that works as a tooltip, the component behavior and appearance makes the application usability better.

For MDI application development the acemdi (acemdi.dev.java.net) seems to be a good choice, with acemdi you can create MDI application very easily, you have only two classes (MDIFrame and MDIView) where MDIFrame is the application window and MDIView is the MDI child, you can add any swing component to your MDI view and then add this MDIView as child of MDIFrame, no complex code.

Share