Results 1 to 3 of 3
- 05-31-2012, 06:46 AM #1Member
- Join Date
- Apr 2012
- Rep Power
Wait for ActionEvent
Trying to write a program that involves waiting for a command from the user to do something. More specifically, I want a command from a JTextField to be executed whenever the "Enter" key is pressed. I'm trying to set a String equal to that value, but not sure how to pause and wait. CountDownLatch? Semaphore? Probably not even on the right track with those.
Any help would be great. Thanks!
- 05-31-2012, 07:30 AM #2
Re: Wait for ActionEvent
You can include a button with an ActionListener. Once user enters command into textfield they must click the button and the action will be fired.
- 05-31-2012, 01:08 PM #3
- By patriotsfan in forum AWT / SwingReplies: 2Last Post: 06-05-2011, 03:17 PM
- By africanhacker in forum New To JavaReplies: 3Last Post: 02-06-2011, 06:08 PM
- By Red727 in forum New To JavaReplies: 8Last Post: 12-07-2010, 04:01 AM
- By Cymro in forum New To JavaReplies: 3Last Post: 04-04-2008, 08:11 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 03-12-2008, 12:00 AM