Internationalizing a String With the GUI Builder
See Also
If you need to internationalize a GUI application, you can use the GUI Builder
to replace a GUI component's hard-coded text with internationalized strings.
To insert an internationalized string with the GUI Builder:
- Open the desired file in the GUI Builder by double-clicking its node in
the Files or Projects window.
- Select the appropriate GUI component in the Inspector window.
- In the Properties window, select the property that you want to internationalize
(for example, the text property of jLabel).
- Select Resource Bundle from the drop-down list at the top of the dialog box.
The property editor switches to resource bundle mode.
If a resource bundle
already exists for the source, the .properties file into which the
internationalized strings will be saved is displayed in the Bundle Name field.
- If no .properties file is listed in the Bundle Name field, click the ellipsis (...)
button next to the field to open the Select Resource Bundle dialog box.
In the dialog box, specify an existing .properties file or
create a new file. Click OK to return to the property editor.
- If you want to change the method used to generate the internationalized
string, click the Format button.
- If you want to add arguments to the method call, click Arguments . You can
add arguments to the method call only if you use the java.text.MessageFormat
or org.openide.util.NbBundle.getMessage formats.
- Type in values for the Key and Value properties and click OK.
- See Also
- Inserting an Internationalized String Into Source Code
- Internationalizing a Single File
Legal Notices