• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Threads with A GUI

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there Ranchers!

I am completely new to threads, and do not really understand it completely.

Here is my code


I know this code isn't the nicest thing in the world, I don't mess around with GUI stuff that much. Its going to be some sort of art deco clock, I know the code will eventually need a complete overhaul.

However, could someone put me in the right direction so that the program checks itself frequetnly, lets say every second, so it updates it and changes the color of the buttons, thus displaying the time.

I cannot implment two things within the class, so here is what i started in another class, but I dont think I am going about it in the right way.



Can someone please boost me in the right direction?
Threads sound like a great concept that can let you do lots of cool things, but I do not think I am implmeneting it correctly. I mainly copied the code above to try to learn from it, and the java.sun docs can be confusing sometimes.

Thanks for any help n advance!

-Sean
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this

 
Sean Magee
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wow, thats much nicer than mine. thanks Micheal for the help.
 
Men call me Jim. Women look past me to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic