• Post Reply Bookmark Topic Watch Topic
  • New Topic

painting nested JComponents  RSS feed

 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • 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
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!