Friday, August 9, 2013

Java Call System Calculator

private void jMenuItem_CalculatorActionPerformed(java.awt.event.ActionEvent evt) {                                                    
         runComponents("Calc.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