Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27994

Re: Newbie question about updating a disabled JTextField

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Newbie question about updating a disabled JTextField
Date 2014-04-09 07:52 -0400
Organization A noiseless patient Spider
Message-ID <li3ca5$79q$1@dont-email.me> (permalink)
References <fe011e0f-cd77-4f34-afff-d51e7e57f9b8@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Newbie question about updating a disabled JTextField angel.gutierrez.rodriguez@gmail.com - 2014-04-09 03:43 -0700
  Re: Newbie question about updating a disabled JTextField Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-04-09 07:52 -0400
  Re: Newbie question about updating a disabled JTextField FredK <fred.l.kleinschmidt@gmail.com> - 2014-04-09 07:10 -0700
    Re: Newbie question about updating a disabled JTextField angel.gutierrez.rodriguez@gmail.com - 2014-04-09 09:10 -0700
  Re: Newbie question about updating a disabled JTextField Roedy Green <see_website@mindprod.com.invalid> - 2014-04-09 11:42 -0700

csiph-web