|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Strange GUI Builder behaviorHi,
Instead of displaying the actual text value of a JLabel, the GUI Builder displays the key found in the resource bundle. So, in the "Design" view as well as in the "Design Preview" window, I see something like "<SomeVisualPanel1.someLabel.text>" in my JLabels, which is the key found in the Bundle.properties file. Interestingly, when I run my application, the "real" value is displayed (e.g. "Name :" instead of "<SomePanel.someLabel.text>"). It's kind of weird, because I didn't make any changes to these panels recently and, if I create some new ones, the GUI Builder behaves normally, displaying the correct text values in my JComponents. Did this happen to anyone else or does somebody have an idea how I could get it to display those values correctly? Thanks, Philippe -- Netbeans 6.7.1 |
|
|
Re: Strange GUI Builder behaviortheophil wrote:
> Hi, > > > > Instead of displaying the actual text value of a JLabel, the GUI Builder displays the key found in the resource bundle. So, in the "Design" view as well as in the "Design Preview" window, I see something like "<SomeVisualPanel1.someLabel.text>" in my JLabels, which is the key found in the Bundle.properties file. The GUI likely cannot find the Bundle.properties file. Is it in the same package as the GUI form? If you click on [...] button for some text property to open a property editor, can you see there the path to the bundle file and is it valid? > > > > Interestingly, when I run my application, the "real" value is displayed (e.g. "Name :" instead of "<SomePanel.someLabel.text>") Then it looks like a bug. If you can share the project where it can be reproduce, please file a bug report. Or sent it to me, I could look at it. > > It's kind of weird, because I didn't make any changes to these panels recently and, if I create some new ones, the GUI Builder behaves normally, displaying the correct text values in my JComponents. By creating new ones you mean creating new forms, or new labels in the same form? - Tomas > > Did this happen to anyone else or does somebody have an idea how I could get it to display those values correctly? > > > > Thanks, > > > > Philippe > > > > -- Netbeans 6.7.1 > > > > |
|
|
Re: Strange GUI Builder behaviorHey,
Did you perhaps copy/paste the Form to create a new one? It is a bug I've noticed. If you duplicate a form with copy/refactor-paste the .form file doesn't get updated properly. Though the code in the .java is updated correctly. So running it works, but when netbeans interprets the .form it still reads the messages from the original form file. Because the properties don't exist in the original one (As the classname change, and thus the property names as well) the GUI builder shows the property name (which is what it does when the property can't be found).
You'll notice this if you change the property values. They are changed in the original Bundle.properties, instead of the new one. The copy/paste behaviour is very buggy, so I rather just create the forms manually and then copy/paste all the components (open the original, select everything, copy) into the new form, and do the same with the code. It's a bit more cumbersome, but at least you know your .form is correct and you won't accidentally mess up the original - which can happen because localization changes in the pasted form updates the original bundle.
I'm not sure if this also happens when you copy/paste in the same package. I've only done it in between packages. Quintin Beukes On Fri, Oct 30, 2009 at 4:22 PM, theophil <kruschitz@...> wrote: Hi, |
|
|
Strange GUI Builder behaviorHi,
Thanks for the fast replies! Quintin got it right, the problem occurs if you copy/paste your panels and forms from one package to another. In my case, I copied them from a different module and the forms were not updated correctly. As Quintin said, the whole thing is still very buggy. Here are some points I noticed: - One problem is that the "bundle" attribute in the <ResourceString> element isn't updated, it still holds the path to the "old" Bundle.properties file. Obviously, that property is overriden somewhere, because I had removed the old module from the module suite, thus making it inaccessible. As the old module still existed, I renamed the old file to make sure my new Panel was using the Bundle.properties in its package. - Adding new labels to the panel is no problem. The correct bundle file is updated and referenced in the form. - If you change the variable name through the properties window (in the 'Code' tab), the form gets updated as well. It changes the name of the component and makes the bundle path point to the new Bundle.properties. The problem is that the key in that properties file isn't updated, resulting in a MissingResourceException. @Quintin : You said the copy/paste was known to be buggy, did someone already file a bug? If not, should I do it? In my case, the original Bundle file was never updated, probably because it was in another module and yours was in another package in the same module. If I copy/paste the whole form by hand, as you proposed, I'm still stuck with a similar problem, as my new bundle file won't be updated if I make changes to 'old' components (even after changing all my ResourceString properties by hand...) I haven't tried this within the same package, but my guess is that it won't do nothing, as you're probably still referencing the same resource bundle. (whereas with localized bundles, this could be a problem) @Tomas The path to the bundle file is displayed and valid. I could send you some code, but the whole thing is pretty easy to reproduce (see above). Regards, Philippe |
| Free embeddable forum powered by Nabble | Forum Help |