Re: Method for White Circle with black background




<sheldon.sc@xxxxxxxxx> wrote in message news:1140083367.168684.275960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need help with making a method to get a white circle with a black
background.
On clicking a button the circle turns to black On clicking the button
again it turns back to the white circle with a black background again.


import aLibrary.*;
import java.awt.event.*;
import java.awt.Color;

public class DotBW extends Dot{
private AOval theDot;

public DotBW(int a, int b){
super(a, b, 50, 50);
//theDot = new AOval();
setColor(Color.black);
}
public void action(){

Color fillColor = this.getColor();

if (fillColor == Color.black) {
this.setToFill();
//this.setColor(Color.white);
//this.setToFill(Color.white);
} else {
//this.repaint();
this.setColor(Color.black);
this.setToFill();
}
this.repaint();
}//end if
}//end class

Could it be that the code that draws a white circle is completely commented out?

- Oliver

.