Results 1 to 2 of 2
  1. #1
    SanLin12 is offline Member
    Join Date
    Apr 2014
    Posts
    1
    Rep Power
    0

    Default Displaying a sequence of SVG Images

    I am trying to make an animation by displaying a series of SVG images uisng Java language. Here is a part of my code.

    Java Code:
    for(int i = 0; i < svgDocList.size(); i++)
    {                    
        try {                       
            Thread.sleep(500);
        } catch (InterruptedException e) {      
            e.printStackTrace();
        }               
    svgCanvas.setDocument(svgDocList.get(i));
    }
    When I run this, the canvas displayed only the first image of the list but did not get update with other images of the list. What could be wrong? or Any other ways of displaying a series of svg images?

  2. #2
    BinaryDigit09 is offline Member
    Join Date
    May 2012
    Posts
    18
    Rep Power
    0

    Default Re: Displaying a sequence of SVG Images

    I can't tell for sure but it like you're calling Thread.sleep() in Swing's event dispatch thread, so it can't paint the new images. If you want to do animations in Java you need to multithread. Google "multi-threading in java Swing" for more.

Similar Threads

  1. images not displaying?
    By imawesum in forum New To Java
    Replies: 1
    Last Post: 01-29-2013, 07:26 PM
  2. displaying images
    By sukanya in forum JavaServer Pages (JSP) and JSTL
    Replies: 6
    Last Post: 03-25-2012, 02:46 PM
  3. [SOLVED] Need help in displaying images
    By kirly in forum Advanced Java
    Replies: 3
    Last Post: 10-21-2008, 05:36 AM
  4. Replies: 0
    Last Post: 08-14-2008, 01:07 PM
  5. Images not displaying in JSP in IE7
    By chadscc in forum Advanced Java
    Replies: 0
    Last Post: 11-13-2007, 03: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
  •