-
Getting a clock hand to go anticlockwise..
Hi. I have this program:
import java.awt.*;
import java.applet.*;
public class Lines2 extends Applet
{
Color blue = new Color(180,255,255);
Color black = new Color(0,0,0);
public void paint(Graphics g)
{
int x = 0;
int y = 0;
double angle = 0;
while(angle<6.28)
{
x = (int)(java.lang.Math.cos(angle)*100) + 120;
y = (int)(java.lang.Math.sin(angle)*100) + 120;
g.setColor(black);
g.drawLine(120,120,x,y);
for(int delay = 0;delay<2000000;delay++);
g.setColor(blue);
g.drawLine(120,120,x,y);
angle = angle + 0.01;
}
g.setColor(black);
g.drawLine(120,120,x,y);
}
}
I would like to modify the program so that the clock hand sweeps anticlockwise to colour in a circle, then make it sweep the other way to erase the colour. I have tried changing the angles etc but can't get it right. Thanks for your time and help.
Cheers.
Steve
-
Problem solved. Thanks anyway.
Cheers
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks