Article View: borland.public.jbuilder.java.swing
Article #10981Re: Component ID
From: Rich Wilkman
Date: Fri, 23 Jul 1999 00:00
Date: Fri, 23 Jul 1999 00:00
51 lines
1849 bytes
1849 bytes
Song:
Sun experimented with dynamic name creation but abandoned it (if you
look at awt components like Button or Label you'll see that their
creation gives them a name+number combo still). The method you describe
of setName() is the only way. Remember, setName() does nothing to
ensure uniqueness. You can name everything Fred if you like.
-Rich
Song Huang wrote:
>
> Hello
>
> let's say, if you dynamically create some JTextFields in this way:
>
> int i = 5;
> while(i > 0)
> {
> JTextField jTextField = new JTextField();
>
> jPanel.add(jTextField);
>
> i--;
> }
>
> does JBuilder give them unique id ? how can you identify each one of
> them ?
> Or, you do it by adding this: jTextField.setName("hello" + i) inside the
> loop ?
>
> Any ideas ?
>
> Thank You.
>
> Song Huang
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Quality Assurance Manager
Borland JBuilder Team
If you see something that looks like an opinion up there,
it's mine and mine alone.
Mail sent to me from the newsgroups won't bounce but will
be ignored. If I have time, I'll respond, but you have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<37989B6B.FCA7C90E@inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37987C76.9E16E2DA@mindspring.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,57f2e796781f7956 X-Google-Attributes: gid111d45,public From: Rich Wilkman <rwilkman@inprise.com> Subject: Re: Component ID Date: 1999/07/23 Message-ID: <37989B6B.FCA7C90E@inprise.com> X-Deja-AN: 504458440 Content-Transfer-Encoding: 7bit References: <37987C76.9E16E2DA@mindspring.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing