• Post Reply Bookmark Topic Watch Topic
  • New Topic

make moon lander image go up and down on jpanel  RSS feed

 
Stephen Norris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a program that is suppose to show a moon lander image going up and down on a JPanel. I don't know what I am doing and have barely got anything down. Below is what I have so far. Can someone please help me at least get started on this. I am a beginning student and I am lost. I am in jeopardy of failing my class if I don't do this. I am not asking anyone to write the program for me, but I don't even know where to start.
 
Sudhanshu Umalkar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Create a image object in init() method.
2. In run() method, keep changing coordinates of image (moon lander) after specific interval of time. I mean, either increment / decrement Y coordinates by a pixel to give the effect of image moving up or down. Call repaint() thereafter.
3. In paint() method, just draw the image with the changed coordinates.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!