This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245018 - Design view displays localization keys instead of the text after restarting IDE
Summary: Design view displays localization keys instead of the text after restarting IDE
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: 537931
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-12 21:18 UTC by 537931
Modified: 2015-09-25 01:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Tiny project to reproduce the bug (27.01 KB, application/x-zip-compressed)
2015-09-23 21:29 UTC, 537931
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 537931 2014-06-12 21:18:16 UTC
The steps to reproduce the problem are:

1. Make a new JPanel.
2. Enable Automatic Internationalization for the panel.
3. Add a label anywhere on the panel.
4. The label will be shown with the default text: jLabel1.
5. Save the project.
6. Restart NetBeans IDE
7. Instead of "jLabel1" the label shows: TestJPanel.jLabel1.text.
8. When you go to text property for jLabel1 the "Bundle Name" is empty.
9. Select the Bundle Name and the label is displayed as "jLabel1" again.
10. Restart NetBeans IDE and the label is displayed as "TestJPanel.jLabel1.text".

When I look inside the TestJPanel.form I see that the Bundle Name is always there.
Comment 1 Tomas Pavek 2015-09-23 14:03:00 UTC
This works fine for me. I've tried a new Java SE project - both default (ant) and maven, created the form in default (no) package, then in some package. Worked fine for me always. This is in current 8.1 dev build.

I guess there must something special, not obvious from the provided steps. Was the Bundle.properties file saved? Does the problem appear only when the GUI form is opened when the IDE restarts, or does it not matter (i.e. happens also when closed and then opened explicitly)? Can you provide a sample project where the bug can be seen?

I'm also wondering if the bug is permanent - the way described it would practically mean the internationalization does not work (does not persist properly). That does not seem to be the case, we'd get it reported many times (though I vaguely remember one or two reports like this). So any details about the occurrence of this bug are welcomed. Thanks.
Comment 2 537931 2015-09-23 21:29:44 UTC
Created attachment 156394 [details]
Tiny project to reproduce the bug

Since then I moved on to 8.0.2. Today I tried to reproduce the problem with this version. I followed my own steps (see above), but the bug did not show up.

Then I took my old project, created with 7.4, removed all packages leaving only one JPanel for the demo. When I open it in 8.0.2 the problem is 100% repeatable.

After opening the project please try the following steps:

1. Open NewJPanel.java in Design mode
2. Instead of "jLabel1" the label shows: NewJPanel.jLabel1.text.
3. Go to the Label properties - the text is empty
4. Click on ... button on the text row - the "Bundle Name" is empty.
5. Press Select... for the Bundle Name
6. Press OK - label displays "jLabel1" again.
7. Restart NetBeans - the label shows: "NewJPanel.jLabel1.text".
Comment 3 Tomas Pavek 2015-09-24 12:19:29 UTC
Thanks for providing the sample project - the project configuration is the reason for the bug. It contains one additional root for execution, the project directory itself. The internationalization support in NetBeans happens to ask the execution classpath of the project for the resource name of the properties file selected by the user - and obtains a path starting with "src/". So it sets the bundle name to "src/bug245018/Bundle". But that is obviously wrong, and even the i18n support itself can't find the file later when the GUI form is reopened. It should be "bug245018/Bundle".

So although it looks like the project is misconfigured, in this case the i18n support should also be fixed to consistently use the source classpath (not execution CP) primarily for determining resource names. It's causing problems not only in GUI builder but also e.g. in the internationalization wizard.

Made a fix:
http://hg.netbeans.org/jet-main/rev/74f6eb0cf5a1

For the attached project the workaround could be to check the file.reference.NetBeansProjects-ASDv5_UAP entry in project.properties and remove it if it is not needed.
Comment 4 537931 2015-09-24 13:45:30 UTC
Thanks for help! It works now.
Comment 5 Quality Engineering 2015-09-25 01:47:33 UTC
Integrated into 'main-silver', will be available in build *201509250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/74f6eb0cf5a1
User: Tomas Pavek <tpavek@netbeans.org>
Log: #245018: properties file resource name should be primarily determined from source path