Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: need help on this. Date: Tue, 07 May 2013 08:14:50 -0400 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: <1ea6b46f-380f-4839-b4dc-74d72a10b5e6@googlegroups.com> <1cbfe10e-bb38-4477-a349-6136495a427f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 7 May 2013 12:11:23 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="1233"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pgmiGi+uXHIxrObclxRtF" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: <1cbfe10e-bb38-4477-a349-6136495a427f@googlegroups.com> Cancel-Lock: sha1:LNwD0c7ufDUboaNvZ/jB2sm03qU= Xref: csiph.com comp.lang.java.programmer:23886 On 5/7/2013 12:29 AM, wee wrote: > just an update, used the suggestion of eric sosman in using setName(), and it worked for me. funny that i never found that setName() method in the JTextField documentation.. Glad it was helpful. Daniele Futtorovic's suggestion of using putClientProperty() looks better, though -- certainly more general, and more powerful. (You probably didn't find setName() in JTextField's Javadoc for the simple reason that it isn't there, or "almost isn't there." If you look closely, you'll find it mentioned in one of the lists of inherited methods: setName() is a method of java.awt.Component, and therefore of all Component's descendants. The putClientProperty() method is also inherited rather than JTextField-specific, this time from javax.swing.JComponent. Moral: When you're looking for a method in some class or other, don't forget to look at the ancestry.) -- Eric Sosman esosman@comcast-dot-net.invalid