| Author |
User Prompt Timer
|
podonga poron
Ranch Hand
Joined: May 12, 2008
Posts: 55
|
|
The following code sets a timer task in console. But i want to implement a user prompt, to the code .. so the user can easily set the value of refreshing time .. something like this ... but the problem with this is i can't pass a String to the constructor .. Is there a way to pass a int value, maybe with casting ? what is the correct way to do this ? thanks a lot ! [ May 12, 2008: Message edited by: podonga poron ]
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
You can't do it with casting, because a String is simply not an int. But you can parse a String as an int using the parseInt method of the Integer class... int myInt = Integer.parseInt(myString);
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
podonga poron
Ranch Hand
Joined: May 12, 2008
Posts: 55
|
|
WOW !! now it works ! THANKS !! i leave the code maybe someone find it useful ..
|
 |
 |
|
|
subject: User Prompt Timer
|
|
|