Results 1 to 3 of 3

Thread: GUI Animation

  1. #1
    serfster is offline Member
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    0

    Default GUI Animation

    Is there a way to code a simple animation such as a picture moving across the screen in a GUI (and not an applet) that uses very little code and is easy to understand?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    There is swing timer you can use. On a tick event you can change the image location on a panel.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by serfster View Post
    Is there a way to code a simple animation such as a picture moving across the screen in a GUI (and not an applet)
    Sure!
    that uses very little code and is easy to understand?
    and therein lies the rub!

    For me, I found that graphics programming was counter-intuitive, especially at first. You really need to read, study, and learn from a decent tutorial on this, but fortunately such a site exists. Please check out:

    Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI with JFC/Swing)

    and specifically: Refining the Design (The Java™ Tutorials > Creating a GUI with JFC/Swing > Performing Custom Painting)

    Good luck!

Similar Threads

  1. Animation with Animated GIF
    By JavaBean in forum Java 2D
    Replies: 3
    Last Post: 06-04-2011, 05:26 PM
  2. Animation Delay - Thread problem
    By wererabit in forum Advanced Java
    Replies: 3
    Last Post: 04-10-2009, 11:35 PM
  3. Text Animation
    By rossomandop@acm.org in forum AWT / Swing
    Replies: 4
    Last Post: 05-30-2008, 04:34 AM
  4. GridLayout with animation?
    By tojas in forum AWT / Swing
    Replies: 3
    Last Post: 11-12-2007, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •