This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hey guys - new here, and to Java programming, and I'm having a bit of difficulty getting a clock program to update properly. As it stands now, the time will update between the time I run the program and click getTime which opens up the window where the clock is displayed. Once it's opened so I can look at the time, it stops updating. When I close it out - but don't recompile or anything like that - the timer restarts.
Below is my code for the two classes I have.
ClockDisplay (This is the one I will have to change)
NumberDisplay (Not really important, but just in case any cross-references are needed...
I think I need to attach a listener to the displayString at the end of my first batch of code. Problem is, I don't know how to do it...
Thanks for any help!
Joined: Nov 15, 2007
Alright, a bit of an update - I put in a while loop that makes the counter to continue even when the program is visible. Now I'm just having a problem with getting the display to show correctly. If I do a System.out.println(displayString); that shows me that the counter is working properly. The displayString(); just doesn't show properly when you execute the getTime(); method.