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.
DrEinstein
0
Newbie Poster
Recommended Answers
Jump to Postuse a thread to update your seconds variable.
Jump to PostIf 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
stultuske
1,116
Posting Maven
Featured Poster
DrEinstein
0
Newbie Poster
DrEinstein
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Taywin
312
Posting Virtuoso
DrEinstein
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.