title: SVG in Java not displaying correctly
body: <p>Ok, I have a Java program, that displays some tiles that are SVGs in a FlowLayout.  It does this by being a class ScrabbleRack, and extending JPanel, then adding JSVGCanvas tiles to this panel.</p>
  
  <p>Afterwards I created a frame and added the panel, this. (packed it and displayed it).  On appearing, the panel does not display properly. It just displays the first tile and then in the space where the rest of the tiles should be displayed, there is whitearea.</p>
  
  <p>But if I resize the frame by any amount, the image will render correctly.</p>
  
  <pre><code>public class ScrabbleRackGUI extends JPanel{
      ScrabbleRack rack=new ScrabbleRack();
      JSVGCanvas rackContentsImages[]=new JSVGCanvas[8];
  
  public ScrabbleRackGUI() {
     setLayout(new FlowLayout());
     createComponents();
  }
  public void createComponents() {
      //INITIALISE SOURCE IMAGES
      initImages();
      for (int i=0;i&lt;rackContentsImages.length;i++){
          this.add(rackContentsImages[i]);
      }
  }
  private void initImages(){
      File tempImages[]=new File[8];
      for(int i=0;i&lt;8;i++){
         tempImages[i]= new File("./src/res/rackBackground.svg");
         rackContentsImages[i]=new JSVGCanvas();
         try {
             rackContentsImages[i].setURI(tempImages[i].toURL().toString());
         } catch (MalformedURLException ex) {
             Logger.getLogger(ScrabbleBoardGUI.class.getName()).log(Level.SEVERE, null, ex);
         }
      }
  }
  public static void main(String args[])
  {
      JFrame frame = new JFrame("ScrabbleTest");
      ScrabbleRackGUI rack= new ScrabbleRackGUI(1);
      frame.add(rack);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.pack();
      frame.setSize(214,70);
      frame.setVisible(true);
  
  }
  }
  </code></pre>
  
  <p>Any ideas on how I can get this panel to display properly, first time.</p>
  
  <p>Or some hack that will resize it at the end of the program.</p>
  
  <hr>
  
  <p>I used <a href="http://xmlgraphics.apache.org/batik" rel="nofollow noreferrer">batik</a> to render the SVGs in Java, for those who want to reproduce this problem.</p>