Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Newbie question about updating a disabled JTextField Date: Wed, 09 Apr 2014 07:52:33 -0400 Organization: A noiseless patient Spider Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 9 Apr 2014 11:52:37 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="7482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SNx1xk2WDvRT9btHL9/xV" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: Cancel-Lock: sha1:CjxQd5XoHmzJU2q9R7ByfqCRLQA= Xref: csiph.com comp.lang.java.programmer:27994 On 4/9/2014 6:43 AM, angel.gutierrez.rodriguez@gmail.com wrote: > Is it possible to change the text of a JTextField when it is disabled? > > I do have 2 JTextFields (a & b) and sometimes, the second one is disbaled and then it has the same value as the first, so I tried: > > b.setText(a.getText()); > > when the first one is changed. But it looks it isn't working. Do I have to enable it first? setText() works on enabled or on disabled fields, so the problem is most likely somewhere else in your code. -- Eric Sosman esosman@comcast-dot-net.invalid