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.
See attachment.
see no attachment
Hmm, looks like the attachment got lost during Bugzilla conversion. Let me try to remember: I think the user pointed out that there is a standard "name" property for Swing (AWT?) components which does nothing by itself but which can be used for things like scripting-language manipulation of visual elements, finding components by name later, etc. I think he suggested that there be some way to have this property be defaulted in the Form Editor, probably to the variable name representing the bean.
having the component's name set to something other than null sometimes can be useful, but definitely not by default. Most of people don't want an extra comp.setName("xxx") in their code.
Created attachment 58 [details] nameproperty.txt - StarTeam
*** Bug 9132 has been marked as a duplicate of this bug. ***
Target milestone -> 3.3
Target milestone -> 3.3.1.
Set target milestone to TBD
This has been ignored for a few years so bumping up the priority a little bit. :-) Martin B. - note that if this had been implemented several years ago and used when creating GUI forms for the IDE, we would probably have the name set for most components already, which could be helpful to QA when creating GUI tests.
The biggest problem with this is as Trung already mentioned: > having the component's name set to something other than null > sometimes can be useful, but definitely not by default. > Most of people don't want an extra comp.setName("xxx") in > their code. This would have to be done as an option which could be turned on additionally. But should be simpler to do than e.g. the mnemonics support in issue 27009.
Agreed that it is probably best as an option, off by default. When on, Component.name would be defaulted from the variable name of the component. Option might need to be per-form rather than global, to avoid rewriting guarded blocks of existing forms when they are opened; or it could be a global option and take effect by literally setting the 'name' property in the form whenever a new component is created or the variable name is changed (and storing the 'name' property redundantly in the .form file).
Still not sure about this (after 6 years!). I guess we need the per-form setting (which is possible as of NB 4.1). The redundant property value would be hard to keep in sync. With the form setting it would be also possible to turn this off/on for whole forms easily.
*** Issue 90024 has been marked as a duplicate of this issue. ***
This was done recently with resources support for Swing Application Framework. Now there is a form-level setting (property) called "Set Component Names" available on root form node which if turned on will set the name property for each component and keep it in sync with the variable name. There's also a global setting (in Options) which determines the default value of the form-level for newly created forms. In the default setup, new forms created as part of app framework project will have the component naming turned on, forms in standard Java SE or NBM projects will have it turned off.
Wow, opened in March 1999, fixed in August 2007 :-)
I see the form property, but I'm not seeing the global option - where is it? I go to Tools > Options > Miscellaneous > GUI Builder and there does not appear to be anything related to setting component names.
Hi, the property is available into Tools > Option > Advanced Options > GUI Builder > Set Components Names. Cheers.