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 204660 - GUI builder does not persist and restore text fields for visual components
Summary: GUI builder does not persist and restore text fields for visual components
Status: RESOLVED WORKSFORME
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-04 02:08 UTC by wobster
Modified: 2011-11-04 14:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wobster 2011-11-04 02:08:36 UTC
Both my colleague and I have experienced a bug in NetBeans 7.0.1 where the text properties of labels, buttons, etc. are not persisted correctly to the associated property file. 

In fact, when I attempt to change the text of a label, the GUI builder will not display the next text field, it continues to display the variable name of the instance. 

I also noticed that empty property files with numbers appended to them are appearing after I edit the GUI.

The Swing Desktop visual components rendered correctly in 6.9.1 and 7.0, but some recent patch seems to have completely broken the 7.0.1 version.
Comment 1 Jan Stola 2011-11-04 07:08:47 UTC
I am sorry, I am not able to reproduce this issue. Could you, please, provide more details. It would be ideal to describe _exact_ steps that lead to this problem. Thank you in advance.
Comment 2 wobster 2011-11-04 11:37:54 UTC
I have an existing Java Desktop Project that was started with NB 6.8 I believe. The project works fine in 6.9.1. 

The steps are simple:

0.) Load original Java Desktop Project in fully updated NB 7.0.1
1.) Create a new panel Junk.java using the GUI builder
2.) Add a label using the GUI builder
3.) Edit the text of the label in place with the GUI builder and replace the default text with some new text
5.) When return is hit, the edited text disappears and is replaced with the original default text
6.) Save all files

There are two property files created in the resources directory: Junk.properties and Junk_1.properties. The only text in the files is:
# To change this template, choose Tools | Templates
# and open the template in the editor.
Comment 3 wobster 2011-11-04 12:17:04 UTC
FYI:

It appears it has nothing to do with the project being created in older versions of NetBeans. I just created a fresh new Desktop project and replicated the behaviour from my "legacy" project.
Comment 4 Jan Stola 2011-11-04 13:25:37 UTC
I am sorry, I am not able to reproduce this problem. I tried to follow your steps:

1. Downloaded NetBeans 7.0.1 build (201107282000-ml-javaee).
2. Started IDE with a new/clean user directory.
3. Updated all modules on Updates tab of Tools > Options.
   => restarted IDE.
4. Created new Java Desktop Application (Basic Application).
5. Created new JPanel form called Junk in the package with other forms.
6. Added JLabel into Junk.
7. Modified text of the label using inplace editing,
   i.e., pressed Space, entered Blabla, pressed Enter

and the label is modified correctly. File Junk.properties is generated and contains jLabel1.text=Blabla

So, you must be doing something in a different way. Are you using a new/clean user directory? Is there any exception thrown?
Comment 5 wobster 2011-11-04 14:11:53 UTC
This problem has occurred on two separate installations on two separate users machines. 

I'm using the following:

Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.6.0_27; Java HotSpot(TM) Client VM 20.2-b06
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\rratcliff\.netbeans\7.

I'll delete my Userdir and retry the test.
Comment 6 wobster 2011-11-04 14:31:33 UTC
Deleting my entire Userdir: C:\Documents and Settings\rratcliff\.netbeans\7.

seems to have fixed the problem. Something must have gotten corrupted during one of the NetBeans updates since both of us here had the same problem. There is likely a bug in the update process, but deleting the userdir isn't too painful.

Thanks for the quick response!