• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I once met a man from Nantucket. He had a tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic