Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding JTextField

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have doubt in JTextField, if i enter some text in JTextField and press enter button,it can open one dialog box,if that dialog box closed, and again press the enter button without enter text in textfield,the previous instance in the textfield should be displayed in the dialog box.actually i am passing a String value in the textfield,it should not be cleared. actually i want to clear the String value, not the textfield.getText() value.

thank you in advance
 
Brian Cole
Author
Ranch Hand
Posts: 906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tadi raja:
actually i want to clear the String value, not the textfield.getText() value.


Note that you haven't actually asked a question.

I'll point out, though, that JFormattedTextField has
a distinction between its value and its visible text.
So you could call setText("") and clear the field without
changing the value returned by getValue(). So if that's
really what you want, JFormattedTextField may (or may
not) be helpful to you.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tadi raja, please use Meaningful Subject Lines when asking questions. "Regarding XYZ" doesn't really help.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic