Hi Thomas,
Thank you for your help. I delayed the call to setURI, and I noticed
I've made a big mistake : I've switch the called "f.setVisible(true)"
and "f.setSize()"... Bad, bad bad
Now my code is the following :
import java.awt.*;
import java.io.File;
import org.apache.batik.swing.*;
public class AWTSVG {
public static void main(String[] args) {
final Frame f = new Frame("Batik");
final MyCanvas canvas = new MyCanvas();
canvas.setDocumentState(JSVGCanvas.ALWAYS_STATIC);
final JSVGScrollPane scrollPane = new JSVGScrollPane(canvas);
scrollPane.setBackground(new Color(22, 22, 22));
f.add(scrollPane);
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
f.setSize(800, 600);
f.setVisible(true);
canvas.setURI(new File("C://eclipse//workspace//test.svg").toURI().toString());
}
}
public class MyCanvas extends JSVGCanvas {
protected AffineTransform calculateViewingTransform(String fragIdent, SVGSVGElement svgElt) {
return new AffineTransform();
}
}
Unfortunately, it still does not work. I can see my image when
the frame is opened, but I need to resize my frame two times if I want
to see the scrollbars
Please help, I'm desperate :(
- Re: [Newbie] JSVGScrollPane problem Laurent Caron
- Re: [Newbie] JSVGScrollPane problem thomas . deweese
- Re: [Newbie] JSVGScrollPane problem Laurent Caron
