Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 
public class SG_Sample implements ActionListenerWindowListener {
    String s = "<xml/>";
    public void actionPerformed(ActionEvent ae) {
        FileReader fr = null;
        try {
            fr = new FileReader("c:/a.out");
        } catch (Exception e) {
        } finally {
            try {
                fr.close();
            } catch (Exception ee) {
            }
        }
    }
    public void windowClosing(WindowEvent we) {
        String s = getRoot();
    }
    private String getRoot() {
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document d = db.parse(new ByteArrayInputStream(.getBytes()));
            return d.getDocumentElement().getNodeName();
        } catch (Exception e) {
            return "";
        }
    }
    public void windowActivated(WindowEvent arg0) {
    }
    public void windowClosed(WindowEvent arg0) {
    }
    public void windowDeactivated(WindowEvent arg0) {
    }
    public void windowDeiconified(WindowEvent arg0) {
    }
    public void windowIconified(WindowEvent arg0) {
    }
    public void windowOpened(WindowEvent arg0) {
    }
New to GrepCode? Check out our FAQ X