wood burning stoves
The moose likes Swing / AWT / SWT and the fly likes problem with JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem with JTextField" Watch "problem with JTextField" New topic

problem with JTextField

kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 77
pls someone how do u retrieve information from ur textfield once it has
been entered by a user into the textfield and u do not want to use a button?
how do you go about writting an actionlistener for a JTextFiled?
thx in advance

Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

Do you want to retrieve the data by the user hitting the Enter key or on a tab out of the field?
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
Hi, Kelly -

Three quick tips:

1. If you spell as badly in your source code as you do in your posts, you'll spend much of your time tracking down compiler errors. Computers require precision.

2. If you read the Java Tutorial, a free in-depth resource available through Sun's Java site, you'll find the answers to most if not all of your questions.

3. If you find the answer yourself, you will always have it. If someone else gives you all your answers, you'll never get it.

Good luck!

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Why are you posting duplicated threads?
That thread got the same topic as this thread. I do suggest you to focus on one thread so that you can get people replies in the same place...

BTW, have you tried DocumentListener as I told you in that thread? It will surely help you...

Co-author of SCMAD Exam Guide, Author of JMADPlus
Siripa Siangklom
Ranch Hand

Joined: Jan 26, 2004
Posts: 79
I think KeyListener and FocusListener is the other way to retrieve data from textfield.
I agree. Here's the link: http://aspose.com/file-tools
subject: problem with JTextField
It's not a secret anymore!