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 270742 - Cannot change TitledBorder from Resource Bundle to Plain Text
Summary: Cannot change TitledBorder from Resource Bundle to Plain Text
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@guibuilder
Depends on:
Reported: 2017-05-26 00:03 UTC by redjaguar
Modified: 2017-06-01 16:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Screen cap demonstrating bug. (8.18 MB, application/octet-stream)
2017-05-26 00:13 UTC, redjaguar

Note You need to log in before you can comment on or make changes to this bug.
Description redjaguar 2017-05-26 00:03:09 UTC
Since NetBeans insists on using it's resource bundle as default, and when a move refactor on a GUI class is done the bundle properties do not move with it... I have to manually change everything to Plain Text.

When a panel has a TitledBorder set with text from the property editor a resource bundle is generated.

Going back to the TitledBorder property, changing to Plain Text looks like it succeeds, but the code generated is for the Resource Bundle that I'm trying to get rid of.

Change the border to "No border" and the border generation code is removed as expected.

Change back to TitledBorder, setting text as plain text, and still a resource bundle is generated.

Video attached shows the bug.

I apologize for the annoying random desktop flashes.. I don't know if it's a driver bug or some bad memory on the video card. (I often have sections of the screen randomly flashing black).
Comment 1 redjaguar 2017-05-26 00:13:45 UTC
Created attachment 164409 [details]
Screen cap demonstrating bug.

Screen capture demonstrating the bug.
Comment 2 Tomas Pavek 2017-06-01 16:41:49 UTC
Thanks for a nice demonstration of the bug. Yes, it is a bug, but it has an easy workaround.

I can see you likely develop your UI as part of a NetBeans module (platform application), is that right? GUI forms created for platform app have the Automatic Internationalization feature turned on by default. That's why it looks like it insists on using resource bundles. In fact for production software it is quite convenient -- you get all texts in one properties file for translations automatically, instead of bothering with hard coded strings in java code.

Anyway, the Automatic Internationalization can be easily turned off and on for the whole GUI form, which will automatically move all texts to plain strings in java code (going off) and then back to resource bundles (on again). So you don't have to do that one by one manually, it can be done once for all, including border titles.

The Automatic Internationalization setting is available when you select the root node in the GUI navigator tree, then find it under the Resources and Internationalization section.

There is also a way to get just the titled border text to plain string as you tried: when you switch the title property editor to "Plain text", note the "Do not internationalize this string" checkbox at the bottom. Checking that will exclude the property from the automatic internationalization completely. This can be used for exceptions when you otherwise want to use the resource bundles on other places. If you don't want it anywhere, turn it off via the root node property.

What you tried on the video should also work, the "Do not..." checkbox should not be necessary. This is a bug. But hopefully the above description helps you.