IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes painting nested JComponents Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "painting nested JComponents" Watch "painting nested JComponents" New topic
Author

painting nested JComponents

Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 111
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

Joined: Oct 13, 2005
Posts: 26720
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.
 
 
subject: painting nested JComponents
 
Threads others viewed
Wanted: example mouse coordinates->world coordinates
painting custom components without extending jcomponent
Messagebox with Mouseevent
Dispalying random dates
Graphics Graphics Graphics - Where are my circles?
developer file tools