Here is my class that tries to use a JRootPane to attach an SVG image as a background image and then add JLabels on top. It doesn't work and just displays the SVG image. If I add the glassPane to the JFrame's contentPane then all I get is a grey nothingness. Why won't the glassPane display the la

public class TestBackgroundSVG
{
 public static void main(String args[])
 {
 JFrame f = new JFrame("Test");
 Container c = f.getContentPane();
 JLabel lab1 = new JLabel("label1");
 JLabel lab2 = new JLabel("label2");

 JSVGCanvas canvas = new JSVGCanvas();
 canvas.setURI("http://localhost:8081/SVGImages/Background.svg");

 JRootPane rootPane = new JRootPane();
 rootPane.setContentPane(canvas);
 rootPane.setGlassPane(new JPanel());

 JPanel glassPane = (JPanel)rootPane.getGlassPane();
 glassPane.add(lab1);
 glassPane.add(lab2);
 glassPane.setOpaque(false);

 c.add(rootPane);

 f.addWindowListener(new WindowAdapter(){
 public void windowClosing(WindowEvent e){
 System.exit(0);
 }
 });

 f.pack();
 f.setSize(200,200);
 f.setVisible(true);
 }
}

any help would be great
cheers
Claire :)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to