Friday, August 9, 2013

Java Call System Notepad


 private void jMenuItem_NotepadActionPerformed(java.awt.event.ActionEvent evt) {                                                 
        runComponents("Notepad.exe");
    }

    protected void runComponents(String sComponents)
    {
        Runtime rt = Runtime.getRuntime();
        try{rt.exec(sComponents);}
        catch(IOException evt){JOptionPane.showMessageDialog(null,evt.getMessage(),"Error Found",JOptionPane.ERROR_MESSAGE);}
    }

No comments:

Post a Comment