This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i need help with a main class that has the Timer class  RSS feed

 
alaina peeler
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im trying to design an application that displays an animation of a horizontal line segment moving across the screen from left to right, eventually passing across a vertical line.

im a little confused on which variables i should set up. ..right now my variables are..
private Timer timer;
private final int DELAY=20;
private int x,y,moveX,moveY;
//and this is where im confused....do i need variables for the horizontal and vertical lines? and do i need variables x1,y1,x2,y2 to draw my these line segments?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, sounds like you're at the very beginning of a rather long journey! See if this helps you get off to a start.

What does it take to describe a line segment in geometry? Two points. Take a look in the API Docs and see if you find something like Point or maybe even Line.

How much code do you have so far? I'd encourage you to start with a clean slate and see what is the simplest possible program you can make run ... maybe just draw one line segment and stop. Then you (and the ranch gang) can go after the rest of the problem in tiny steps.

Heh, I put a link to my own C: drive in there before. Fixed it on 01/13.
[ February 13, 2006: Message edited by: Stan James ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!