• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

animation in java

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm developing a cell phone simulation ( to learn java graphics ) using java applet. This applet should allow clicking on buttons just like real phone. I know this sort of application involves lot of work but I just want to learn the basic idea to develop such animation.
I really appreciate some guidance.
Thanks
 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think you should be doing this with the help of j2me platform ..... check out www.sun.java.com for more info on j2me.

Originally posted by Dilipkumar Kalyankar:
Hi,
I'm developing a cell phone simulation ( to learn java graphics ) using java applet. This applet should allow clicking on buttons just like real phone. I know this sort of application involves lot of work but I just want to learn the basic idea to develop such animation.
I really appreciate some guidance.
Thanks


 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most animation in java deals with sequences of Images and threads to control the frame rate... with what you describe I don't think you would need a thread, though... just have an image of each button in the up position and in the down position and have a MouseListener to change the images. Since the redraw will only be a small area ( the graphic of the button ) you may want to look into the topic of clipping...

HTH,
-Nate
 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys...
I need to implement something like this: http://nytest.liveproducts.com/A2218z/
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're going to need to look into threads to control the animation of the main panel... do the buttons just like I mentioned above... and to make the animation smoother, look into double-buffering. It improves the quality of the animation by drawing to an offscreen image and then drawing the offscreen image to the applet in one step, so you don't have redraw problems... here's a quick example of how to do double buffering...

-Nate
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic