Results 1 to 4 of 4
  1. #1
    Maulik is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default Displaying moving images

    Hi everyone. I am new to Java Swing and want to develop a swing code to show a moving image along with static images just like the file transfer box which is shown when you are copying(not the progress bar). Any help in terms of examples to demonstrate the same will be helpful for the same.

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    sorry to burst your bubble but the file transfer boxes usually use a GIF animation to appear to have a moving image.

    anyhow, this is how you display an image:
    Java Code:
    java.net.URL IMG_URL = new URL("http://www.myfitnessstudio.co.uk/wp-content/uploads/megan_fox4.jpg");
    ImageIcon myImage = new ImageIcon(IMG_URL);
    JLabel myLabel = new JLabel();
    myLabel.setIcon(myImage);

    try and add your three pictures first and tell us if u run into a problem
    Last edited by ozzyman; 03-28-2011 at 01:33 AM.

  3. #3
    Maulik is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default What other options do I have??

    What will be the other options that could help me show the file transfer if it needs to be influenced by the amount of transfer (any code that allows animation in Java)??
    thanks for the reply...

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Use a JProgressBar and use the percentage figure from it to decide how far along your animation is at the time

Similar Threads

  1. Images not moving Please help!!!
    By reborn567 in forum New To Java
    Replies: 11
    Last Post: 11-09-2010, 06:25 PM
  2. ordering moving images in swing
    By IAnkit in forum AWT / Swing
    Replies: 2
    Last Post: 09-21-2010, 04:56 PM
  3. [Applet] Clicking images & moving them.
    By Perfectworld in forum Java Applets
    Replies: 17
    Last Post: 01-16-2010, 09:09 AM
  4. Moving Images in JPanel
    By killpoppop in forum AWT / Swing
    Replies: 7
    Last Post: 03-08-2009, 03:54 PM
  5. Images not displaying in JSP in IE7
    By chadscc in forum Advanced Java
    Replies: 0
    Last Post: 11-13-2007, 04:24 PM

Tags for this Thread

Posting Permissions

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