Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import canvasML.Ellipse;
- public class canvasss
- {
- /**
- * @param args
- */
- public static void main(String[] args)
- {
- int dx =10;
- int dy =10;
- int x = 0 ;
- int y = 0 ;
- Ellipse el1 = new Ellipse (x, y ,20 , 20,"red");
- while (true)
- {
- x = x + dx;
- y = y + dy;
- el1.moveTo (x,y);
- el1.draw();
- if (!(x <= 350 ) && (x >= 50) )
- {
- dx = -dx;
- }
- if (!(y <= 550)&& (y <= 50) )
- {
- dy = -dy;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment