I am using these if statements to change which line is drawn, but the line never changes and I dont' know why. Heres my code:
Hope someone can fix it, thanks in advance.Code:import java.applet.*;
import java.awt.*;
public class DrawingLines extends Applet {
int width, height, x;
Boolean wait = true;
public void init() {
x = 1;
width = getSize().width;
height = getSize().height;
setBackground( Color.black );
}
public void main(String args[]) {
try
{
Thread.sleep(2000); // do nothing for 1000 miliseconds (1 second)
}
catch(InterruptedException e)
{
e.printStackTrace();
}
wait = false;
}
public void paint( Graphics g ) {
repaint();
g.setColor( Color.green );
if (wait == true) {
g.drawLine(20, 20, 100, 100);
}
if (wait == false) {
g.drawLine(0, 0, 150, 100);
}
}
}

