Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java -> Netbeans -> JTextField.name property???

57 views
Skip to first unread message

Willy Wankalot

unread,
Mar 22, 2008, 6:59:04 PM3/22/08
to
Hi

New to java, but seasoned in other languages like C++. Anyway, first time
using Netbeans for java.

When using the gui designer to place a text component in a dialog, I get a
default "JTextField1" name for it from the gui designer. so far, so good.
But when I rename it to something else like "Username" in the "name" field,
the change is not made in the source. However, when I right click the
JTextField component and do "change variable name", it changes the source
code *and* name field correctly. Is this a bug in the IDE or am I
misinterpreting the use of the "name" field in the properties box?

No big deal ... I just need to use the right-click method to change the
name, but I would like to verify this behavior is not just my install of it,
or anything else I might be overlooking about the behavior of the gui
developer. TIA


Sabine Dinis Blochberger

unread,
Mar 24, 2008, 7:20:06 AM3/24/08
to
Willy Wankalot wrote:

I think you want "change variable name". "name" is/can be used for other
things then unique identification.
--
Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

Cam21

unread,
Dec 29, 2010, 3:51:30 PM12/29/10
to
I am using NB6.9.1 and I am getting exactly the same "problem", any solution?


John B. Matthews

unread,
Dec 30, 2010, 12:20:13 AM12/30/10
to
In article <WcKdnaxmfIDPAobQ...@giganews.com>,
Cam21 <us...@compgroups.net/> wrote:

> I am using NB6.9.1 and I am getting exactly the same "problem", any solution?

Amplifying on Sabine Dinis Blochberger's helpful response earlier in
this thread [1], "name" is an attribute of all Components [2]. AFAIK,
it doesn't affect the appearance or function of the Component in any
way. I can't recall using it except to differentiate among instances
while tracing execution. In contrast, the thing modified by "Change
Variable Name..." is the identifier used to refer to a Component in the
generated source code.

I see this as a useful distinction rather than a "problem". Can you
elaborate?

[1]<http://groups.google.com/group/comp.lang.java.gui/browse_frm/thread/123bf70c2a673eec>
[2]<http://download.oracle.com/javase/6/docs/api/java/awt/Component.html#getName()>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

0 new messages