-
Button press loop
Hi folks,
I am new to java and was wondering is there a way in which a java program can simulate button press such as x into a text box and loop every 2 minutes.
All help welcomed.
Thanks.
-
I think YourTextField.setText(YourTextField.getText()+"x"); would work for the adding the x bit. Other than that, you'll need your run() to have a sixty second wait and just loop.
-
Re: Button press loop
Originally posted by tm251
Hi folks,
I am new to java and was wondering is there a way in which a java program can simulate button press such as x into a text box and loop every 2 minutes.
All help welcomed.
Thanks.
buttons support a method doClick() that programmatically simulates clicks on a button.
you may wish, however, to use a java.awt.Timer object, which emits window events at a specified interval to all interested listeners.. all you would have to do is configure a Timer than emits an ActionEvent to certain buttonhandlers every 60 seconds...
note hough, that enetering an X into a text box, and pressing a button, are 2 very different things...
-
I think he may have meant pressing a keyboard button.
-
heh.. yes.. i just figured it out upon rereading.. funny, the ambiguities of language....
anyways, yes you can.. just have a look at the event model. theres a page about it here:
http://www.utoronto.ca/atrc/referenc...usings/Events/
-
Thanks folks for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|