• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Java, Color reference & paint component issue

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

ssjwizard

Has slightly less legible writing than Thideras
Joined
Mar 12, 2002
Ok so hes my situation. I am writing an application with several panels that need to know about a single common color. So I thought my solution was going to be have the JFrame hold a color object, and each of the panels when they are constructed are passed the color object. Ok so one of the panels must be capable of updating the color so I used a color chooser to update the panels Color object. I know whats happening is that a new object is being assigned to the local reference, but shouldn't that propagate through to the other panels?

The other small issue I am having deals with repaint(). Basically my center panel is updating everytime a control is activated from panels a or c which is infact working. However the problem is that its not discarding the original images its just drawing over them. Resizing the window fixes the graphics.
 
Back