• Post Reply Bookmark Topic Watch Topic
  • New Topic

Object Animation in For Loop  RSS feed

 
Amil Mehmedagic
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the following code:
SquareFigure.create();
for (int i = 1; i <= 50; i++) {SquareFigure.moveRight(1);
Delay.milliseconds(100);}
Is it possible to set the Colour of the object SquareFigure, so that it changes every time the object moves one pixel to the right (50 times), in the course of the loop?
What would be the code for such a loop that each time the object moves it changes its colour?
Thanks for all responses!
 
Atrus Greyor
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THis won't help you directly but it would probally help you to post in the Swing / JFC / AWT forum. That is the place to get all your graphic questions answered.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!