Sudhir,
I think this is a classpath issue as the compilation error tells you
that org.apache.batik.swing.JSVGCanvas does not exist. Try this:
a. Get the developer release of batik 1.0.
b. Go into the xml-batik directory after you have expanded the distrib.
c. Do: build.sh svgbrowser (or build svgbrowser on Windows).
This should compile everything and then run the SVG browser.
d. Try compiling you file from the xml-batik directory as follows:
javac -classpath ./classes;./resources;./lib/crimson-parser.jar;
./lib/js.jar <myFile>.java
Does either c or d fail? If yes, what error do you get?
I hope this helps.
Vincent.
sudhir hs wrote:
>
> Dear Vincent,
> I tryied putting all jar files available in batik-1.0 and xml-batik to
> jdk/jre/lib/ext folder and also I have set all these jar files in classpath
> environment variable. and while compiling also I have tryied with running a
> batch file which also sets class path having all these jar files. still the
> proble I am working on WINNT .
>
> Plese guide me
>
> Regards
> Sudhir H S
>
> >From: Vincent Hardy <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: New to Batik - Please Help
> >Date: Thu, 20 Sep 2001 12:09:31 +0200
> >
> >Sudhir,
> >
> >This looks like a classpath issue. Make sure you have the proper
> >jars in your classpath or, alternatively, use ant and the build.bat
> >or build.sh scripts.
> >
> >Vincent.
> >
> >sudhir hs wrote:
> > >
> > > Hello,
> > >
> > > I am new to batik. I have downloaded batik-1.0 and xml-batik. set the
> > > classpath and all. and tryed to compile one example program from that
> >batik
> > > doc. I am getting the errors like
> > >
> > > package org.apache.batik.swing.JSVGCanvas not exists
> > > package org.apache.batik.swing.gvt not exhists
> > > ...
> > > ..
> > > Below is the code for which I got this error
> > >
> > > import java.awt.*;
> > > import java.awt.event.*;
> > > import java.io.*;
> > > import javax.swing.*;
> > >
> > > import org.apache.batik.swing.JSVGCanvas;
> > > import org.apache.batik.swing.gvt.*;
> > > import org.apache.batik.swing.gvt.GVTTreeRendererEvent;
> > > import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter;
> > > import org.apache.batik.swing.svg.SVGDocumentLoaderEvent;
> > > import org.apache.batik.swing.svg.GVTTreeBuilderAdapter;
> > > import org.apache.batik.swing.svg.GVTTreeBuilderEvent;
> > >
> > > public class SVGApplication {
> > >
> > > public static void main(String[] args) {
> > > JFrame f = new JFrame("Batik");
> > > SVGApplication app = new SVGApplication(f);
> > > f.getContentPane().add(app.createComponents());
> > >
> > > f.addWindowListener(new WindowAdapter() {
> > > public void windowClosing(WindowEvent e) {
> > > System.exit(0);
> > > }
> > > });
> > > f.setSize(400, 400);
> > > f.setVisible(true);
> > > }
> > >
> > > JFrame frame;
> > > JButton button = new JButton("Load...");
> > > JLabel label = new JLabel();
> > > JSVGCanvas svgCanvas = new JSVGCanvas();
> > >
> > > public SVGApplication(JFrame f) {
> > > frame = f;
> > > }
> > >
> > > public JComponent createComponents() {
> > > final JPanel panel = new JPanel(new BorderLayout());
> > >
> > > JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
> > > p.add(button);
> > > p.add(label);
> > >
> > > panel.add("North", p);
> > > panel.add("Center", svgCanvas);
> > >
> > > // 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 {
> > > svgCanvas.setURI(f.toURL().toString());
> > > } catch (IOException ex) {
> > > ex.printStackTrace();
> > > }
> > > }
> > > }
> > > });
> > >
> > > // Set the JSVGCanvas listeners.
> > > svgCanvas.addSVGDocumentLoaderListener(new
> > > SVGDocumentLoaderAdapter() {
> > > public void documentLoadingStarted(SVGDocumentLoaderEvent e)
> >{
> > > label.setText("Document Loading...");
> > > }
> > > public void documentLoadingCompleted(SVGDocumentLoaderEvent
> >e) {
> > > label.setText("Document Loaded.");
> > > }
> > > });
> > >
> > > svgCanvas.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter()
> >{
> > > public void gvtBuildStarted(GVTTreeBuilderEvent e) {
> > > label.setText("Build Started...");
> > > }
> > > public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
> > > label.setText("Build Done.");
> > > frame.pack();
> > > }
> > > });
> > >
> > > svgCanvas.addGVTTreeRendererListener(new
> >GVTTreeRendererAdapter() {
> > > public void gvtRenderingPrepare(GVTTreeRendererEvent e) {
> > > label.setText("Rendering Started...");
> > > }
> > > public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
> > > label.setText("");
> > > }
> > > });
> > >
> > > return panel;
> > > }
> > > }
> > >
> > > Please help me as soon as possible.
> > > Regards
> > > Sudhir H S
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> > >
> > > ---------------------------------------------------------------------
> > > 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]
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]