Results 21 to 23 of 23
- 04-09-2009, 12:46 AM #21
Member
- Join Date
- Jan 2009
- Posts
- 14
- Rep Power
- 0
i implemented the timer
so there are two conditions for this process
1) while the user hasn't switched it off with the button
2) while the process occurs under a certain amount of times(set by the user prior to clicking on the button)
the timer works fine with the first condition, but there is no way to control the second condition(since you can only make it start and stop)
and i'm going to try this with the button, so forget key binding
so yeah, i'm going to manually thread it thenLast edited by infinity; 04-09-2009 at 12:49 AM.
- 04-09-2009, 01:04 AM #22
You could implement a counter that stops the timer after the specified number of firings. Something like
Java Code:int counter = 0; int limit; public void actionPerformed() { counter++; if (counter >= limit) { timer.stop(); } // blah }Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 04-09-2009, 01:08 AM #23
Member
- Join Date
- Jan 2009
- Posts
- 14
- Rep Power
- 0
Similar Threads
-
Key event
By ivvgangadhar in forum Threads and SynchronizationReplies: 1Last Post: 12-11-2008, 09:27 AM -
MouseDragged Event
By Preethi in forum New To JavaReplies: 1Last Post: 03-04-2008, 05:09 AM -
Event
By nt5515 in forum New To JavaReplies: 0Last Post: 02-15-2008, 04:44 PM -
Listener for SWT event
By Java Tip in forum Java TipReplies: 0Last Post: 01-08-2008, 09:04 AM -
SWT Event Handling
By Java Tip in forum Java TipReplies: 0Last Post: 12-30-2007, 12:21 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks