• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

painting nested JComponents

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Goal: create a threaded "WaitIndicator" JComponent that itself consists of 12 "LightSegment" JComponents arranged in a circle like on the face of a clock. When triggered, WaitIndicator should sequentially paint a LightSegment its base color and the previous LightSegment set to grey.

This code does not yet try the threading or triggering or sequencing, just initializes an instance of WaitIndicator. For the moment I've hardcoded the initial colors of the 12 LightSegments to make debugging easier.

Problem: I'm not seeing the 12 LightSegments initialized to their correct colors - all appear black. So I'm obviously doing something wrong.


As always, all hints, suggestions, comments, constructive critisms and especially examples are all welcome.

TIA,

Still-learning Steve
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where are you painting the elements in segArray?
You appear to be painting the circle 12 times.
There are all sorts of style and design issues, too.

I shall move this discussion to our GUIs forum.
reply
    Bookmark Topic Watch Topic
  • New Topic