Hi all,
I use batik and canvas class to load and display an svg image .
Here my java code and please find attached the xml code of my svg image
mainFrame = new JFrame("Task Graph");
mainFrame.setSize(800,600);
mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
mainFrame.setVisible(true);
Container pane = mainFrame.getContentPane();
pane.setLayout(new BorderLayout());
JSVGCanvas canvas = new JSVGCanvas();
canvas.setURI("output.xml");
pane.add(canvas, BorderLayout.CENTER);
pane.setVisible(true);
My problem is when I run the code:, I get this error:
."svg error: content is not allowed in prolog".
Could you help me please!!
Thank you in advance
[Updated on: Thu, 21 January 2021 04:36] by Moderator