Product Version: NetBeans IDE 6.8 (Build 200912041610) Java: 1.6.0_17; Java HotSpot(TM) Client VM 14.3-b01 System: Windows 7 version 6.1 running on x86; Cp1252; en_GB (nb)
Hello, newbee java programmer here and wondering if someone can help, I have been having some problems updating a GUI for a desktop application in netbeans, here are the details:
my current application GUI works great, everything is appearing correctly.
when I update the GUI by adding a new label from the netbeans toolbox onto my form, and use the netbeans preview function, everything looks great
however when i run the application the new label has disappeared..
to try and understand the problem i ran the app in debug mode and stepped through the auto-generated initComponents() code
from debugging i believe the problem comes from this line of code:
TEST_lbl.setText(resourceMap.getString("TEST_lbl.text")); // NOI18N
after this line of code has executed TEST_lbl.setText is equal to null..
so the label is disappearing when i run the app because it has no text value to display...
i opened the resource map file in notepad (the .properties file) and it contains an entry "TEST_lbl.text=jLabel1" among the entries for all the other working controls...
so the properties file has the correct value, but resourceMap.getString is not retrieving it
i can work around this problem by changing the "Automatic Resource Management" option of the form from "All Resources" to "Off"
as a result this changes the auto-generated "setText" code line to:
TEST_lbl.setText("jLabel1");
and makes the label display correctly when the application runs
my first question would be, is this a known bug? or have i done something silly and accidently changed a setting someware?
if this is not a bug, how do i correct the problem without changing the resource management setting?
if this is a bug, what are the implications of turning off automatic resource management?
Thanks for the help, - Gaz