permaculture playing cards*
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
Author

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.
tmpTimeField.addActionListener(myListener);
Any ideas how this can be solved ?
Is there a Click Listener ?
Thanks
/ James
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Problem solved using FocusListeners..
Example:
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: http://aspose.com/file-tools
 
subject: JTextField Listener
 
Similar Threads
JInternalFrame
keypad
altering a GUI object without triggering the listener
How to make all the text in a JField selected when JField is in focus?
Disable DoubleClick in JTextField