infoLabel.setText("Parsing and Rendering");
infoLabel.setText("Starting ......");
    public void initialize() {        frame = new JFrame("SVGViewer");        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        // the uri-panel        JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 8, 3));        panel.add(new JLabel("Url:"));        uriField = new JTextField(30);        uriField.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    Runnable r = new Runnable() {                            public void run() {                                load(new File(uriField.getText()));                            }                        };                    Thread t = new Thread(r);                    t.start();                }            });        panel.add(uriField);        fc = new JFileChooser();        JButton button = new JButton("Open");        button.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    int value = fc.showOpenDialog(frame);                    if (value == JFileChooser.APPROVE_OPTION) {                        svgCanvas.setSVGDocument(null);                        Runnable r = new Runnable() {                                public void run() {                                    infoLabel.setText("Parsing and Rendering");                                    cards.show(parentPanel, "info");                                    File file = fc.getSelectedFile();                                    uriField.setText(file.getAbsolutePath());                                    load(file);                                    cards.show(parentPanel, "view");                                }                            };                        Thread t = new Thread(r);                        t.start();                    }                }            });        panel.add(button);        button = new JButton("Zoom in");        button.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    SwingUtilities.invokeLater(new Runnable() {                            public void run() {                                AffineTransform at = new AffineTransform();                                scaleXY += .3;                                at.setToScale(scaleXY, scaleXY);                                svgCanvas.setRenderingTransform(at);                            }                        });                }            });        panel.add(button);        button = new JButton("Zoom out");        button.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    SwingUtilities.invokeLater(new Runnable() {                            public void run() {                                AffineTransform at = new AffineTransform();                                scaleXY -= .3;                                at.setToScale(scaleXY, scaleXY);                                svgCanvas.setRenderingTransform(at);                            }                        });                }            });        panel.add(button);        button = new JButton("Export JPEG");        button.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    int value = fc.showSaveDialog(frame);                    if (value == JFileChooser.APPROVE_OPTION) {                        Runnable r = new Runnable() {                                public void run() {                                    File file = fc.getSelectedFile();                                    try {                                        saveToJPEG(new FileOutputStream(file));                                    } catch (FileNotFoundException e) {                                        e.printStackTrace();                                    }                                }                            };                        Thread t = new Thread(r);                        t.start();                    }                }            });        panel.add(button);        frame.getContentPane().add(panel, BorderLayout.NORTH);        cards = new CardLayout();        parentPanel = new JPanel(cards);        svgCanvas = new JSVGCanvas();        JSVGScrollPane sp = new JSVGScrollPane(svgCanvas);        sp.setBorder(new SmallShadowBorder());        parentPanel.add(sp, "view");        parentPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));        infoLabel = new JLabel("DXF2SVGViewer", JLabel.CENTER);        parentPanel.add(infoLabel, "info");        parentPanel.setPreferredSize(new Dimension(640, 480));        frame.getContentPane().add(parentPanel, BorderLayout.CENTER);        frame.pack();        frame.setVisible(true);    }