File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTextField Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField Listener" Watch "JTextField Listener" New topic

JTextField Listener

James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Hi Ranchers,
I need a listener on a JTextField to be actioned so to speak when a click is made in the box using the cursor.
Using ActionPerformed only works when RETURN is hit.
Any ideas how this can be solved ?
Is there a Click Listener ?
/ James
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Problem solved using FocusListeners..
Dorothy Finkel-Laverty
Ranch Hand

Joined: Nov 24, 2001
Posts: 51
Silly question, but have you thought about using a MouseListener? You can count the clicks and everything. The problem with the solution you are proposing is that even if the user tabs to the text field, the event will be fired. Is that what you want?
I agree. Here's the link:
subject: JTextField Listener
It's not a secret anymore!