Hi Peppe,
You didn't set the background of the foreground JSVGCanvas
to something transparent:
canvas2.setBackground(new Color(0, 0, 0, 0));
Also make sure your SVG Document doesn't have an opaque 'background'
to it.
Peppe <[EMAIL PROTECTED]> wrote on 03/31/2007 03:38:11 PM:
>
> i tried to use JLayeredPane in this way, but it doesn't works (it
doesn't
> shows both document):
>
> public JComponent createComponents() {
> // Create a panel and add the button, status label and the SVG
> canvas.
> panel = new JPanel(new BorderLayout());
> layer = new JLayeredPane();
> layer.add(svgCanvas, new Integer(1));
> layer.add(svgCanvas2, new Integer(2));
> JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
> p.add(button);
> p.add(getJSlider(), null);
> p.add(label);
>
> panel.add("North", p);
> panel.add("Center", layer);
>
>
> // Set the button action.
> button.addActionListener(new ActionListener() {
> public void actionPerformed(ActionEvent ae) {
> JFileChooser fc = new JFileChooser(".");
> int choice = fc.showOpenDialog(panel);
> if (choice == JFileChooser.APPROVE_OPTION) {
> File f = fc.getSelectedFile();
> try {
> if(svgCanvas.getURI() == null){
> svgCanvas.setDocumentState(JSVGCanvas.
> ALWAYS_DYNAMIC);
> svgCanvas.setURI(f.toURL().toString());
>
> }else{
>
> svgCanvas2.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> svgCanvas2.setURI(f.toURL().toString());
> }
> } catch (IOException ex) {
> ex.printStackTrace();
> }
> }
> }
> });
>
> return panel;
> }
> }
>
> --
> View this message in context: http://www.nabble.com/load-2-svg-file-
> into-1-svgCanvas-tf3492392.html#a9771480
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]