I am writing an application in Java and I would like to add a counter in it that the user can start and stop. It would count in second and then go to minutes and up to hours (not days or months). What would I do to make something like this?
Here is how it would function:
- User clicks 'start'
- Counter starts...
- User clicks 'pause'
- Counter stops but doesn't reset
I am new to Java so is there any code that I could look at that does this or something similar to this? If not could someone write me a little code to get me started with this?