Hi everyone, I'm new here. I have a problem and I hope someone can help me with it. Actually, my problem involves arrays but its about the Gregorian Calendar class. I am trying to output a series of concentric circles . I have created two classes with two different types of patterns. I would like to show one of the two patterns accordingly with the seconds. That is, when the seconds of the clock are even,Bullseye1 pattern shows and when odd, Bullseye pattern shows. I am having problems when trying to refresh the seconds because it is getting the second only once. Another problem is that I don't know how to check the numbers(even) that I put in an array witht the current seconds(integer variable). I hope someone can help. Thanks again.
Jump to Post
use a thread to update your seconds variable.
Jump to Post
If this is a Swing app that needs its GUI refreshed every second then I would advise a Timer rather than doing your own thread. (Either will work, but a timer is less likely to give you problems.)
Have a look at javax.swing.Timer You create one that runs every 1000 …
All 6 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.