Using Graphic Classeshow might you fill a shape with a colou

Using Graphic Classes,how might you fill a shape with a colour? E.g., suppose you drew an ellipse/oval; how would you make it a filled, blue oval?

Solution

Suppose if I consider a rectangular to be filled with gray colour,need to use following code:

public void paint(Graphics g)
{
    g.setColor(Color.gray);
    g.drawRect(100, 100, 600, 600);
    g.fillRect(100, 100, 600, 600);
}

Using Graphic Classes,how might you fill a shape with a colour? E.g., suppose you drew an ellipse/oval; how would you make it a filled, blue oval?SolutionSuppos

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site