File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Animation

 
John Spindler
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok everybody I need some help. I am trying to do graphic animation. I read through all 4 of the HelloAnimThread exaples as you'll see in a min =), anyway my project involves having two text fields for the user to input a X and a Y coordinate then once they hit the "Move" button, the small image should as smoothly as possible move to that X,Y coordinate. If you can guess I am having a bit of trouble. In my code I've made use of the double buffering technique (and I don't know if this is a good idea or not) but I'm drawing the "onsite" image 50 pixels from the top of the Y axis to give me room for the text fields and the button. (One of the previous requirements was to add an image to a label and have that move around the screen, is that even possible?), Can anyone think of a better way of doing this? I would greatly appreciate it! Thanks!<br><br>
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, the starting point is good. I think that the smooth animation is to be done by
letting the thread 'sleep' for some time.
I tried to adjust your code, but succeeded (until now) only for the very first loading where a
'cursor' moved very smooth from one place to another. (now for me holydays start will be back in three weeks)
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe this is nearby the solution you look for!
It moves the cursor rather smootly nearby the desired posistion.
Use the sleep time to adjust speed too?!
//I tried to obey the Cattledrive Styleguide
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic