xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claire WALL" <K995...@atlas.kingston.ac.uk>
Subject using SVG image as background/JRootPane
Date Mon, 17 Mar 2003 12:36:50 GMT
<color><param>0100,0100,0100</param>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 :)</color>

<nofill>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message