Replacing Image for a String
please have a look my code
public void draw(Graphics g)
{
final int x = 20;
final int y = 40;
final int width = 40;
if(getColor())
{
g.setColor(Color.WHITE);
g.setFont(new Font("Courier", g.getFont().getStyle(), width));
g.fillOval(10, 10, width, width);
g.setColor(Color.BLACK);
}
else
{
g.setColor(Color.BLACK);
g.setFont(new Font("Courier", g.getFont().getStyle(), width));
g.fillOval(10, 10, width, width);
g.setColor(Color.WHITE);
}
g.drawString("+", x, y);
}
in this code "g.fillOval(10, 10, width, width);" line will displays a Oval, now i have to replace the Oval with an image (png) from one folder.
how can i do this?