Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
RectThread rt = new RectThread(myFrame);
rt.start();
public class RectThread extends Thread
{
private Frame mFrame;
public RectThread(Frame f)
{
mFrame = f;
mFrame.getGraphics().setColor(Color.RED);
}
public void run()
{
Graphics g = mFrame.getGraphics();
Color c = g.getColor();
while(true)
{
if (c.equals(Color.RED))
{
c = Color.BLUE;
}
else
{
c = Color.RED;
}
g.setColor(c);
g.drawRect(100,100,100,100);
try { sleep(1000); } catch(Exception eSleep) {}
}
}
}