This content has been marked as final. Show 2 replies
More specifics please, at first glance I see that your grid will tend toward all yellow and then not convert any more, since you convert from blue to green to yellow. Yellow is a terminal color in your scheme, since it doesn't have a conversion.
Also if you override paint(), you should show that code.
A couple of points:
1. Don't you need to set all of the grid members Game objects' background colors to blue to start with?
2. One way to do this is to add a MouseAdapter extended object to each of the grid's Game objects. Then when the Game panel is clicked, you can easily know which panel was clicked via the MouseEvent#getSource() method, check it's background color, and set the color appropriately.
3. If you do this, then the BPanel class (BedazzledPanel? I'm confused as your class has two conflicting names here) doesn't have to implement the MouseListener interface -- something it probably shouldn't be doing anyway.