the time does not update itself
Is the run() method called? What is the value of the variable: string that is used to set the text?
Add a print statement to see what string's value is.
And when hours and minutes are equal with the numbers from JTextField I want to do something...I made it do something but only if you put the hour and minute that you open the clock at it executes alarm but if i put next minute it wont do nothing..can you please help me
You would use a Timer, but usually a Swing Timer, not java.util.Timer. The Swing times calls an action listener.
I also don't like the loops; you have an infinite loop, and a while loop whose duration I am not certain about.
When you reach my age, you won't want to mess with infinite loops
Norm Radder wrote:. . . What is a good way to show the OP what his endless for loops are doing?
You mean like looking in the Java™ Tutorials for a section about Timers?
Or Should we just say BAD and work together to find a better way?
Bananas aren't even fit to eat until they turn brown. I once went to Central Africa and they had red bananas there: much nicer. But that loop will run longer than it takes for your bananas to ripen.
Norm Radder wrote:. . . Like not buying any green bananas. . . .
Yes, I think you did.
Looks like I registered here 2 months before you.