Hi again.
I'm trying to recreate the digital timer in Minesweeper:
Top right ----- http://www.uberreview.com/wp-content/uploads/506x363-minesweeper.jpg
000 -> 002 -> ... -> 009 -> 010 -> etc...
I couldn't think of an easier way to do it except to create an Icon for each number and match it to it's corresponding integer..
BUT, I cant seem to figure out why this piece of code doesn't draw the image onto the JPanel:
public class DigitalTimer extends JPanel{
Image ZERO = Toolkit.getDefaultToolkit().getImage("images/Numbers/0.gif");
public void paintComponent(Graphics g) {
g.drawImage(ZERO, 30, 30, Color.black, this);
g.drawLine(0, 0, getWidth(), getHeight());
}
}
Here is my transparent .gif for the number 0:
http://img372.imageshack.us/img372/2681/73510927gk3.gif
As you can see from:
g.drawImage(ZERO, 30, 30, Color.black, this);
I'm trying to draw it on a black background so it looks nice.
when I do drawLine(....), it seems to work fine...
Any ideas? For how to do it this way, or if you can think of a better way?