How to get access computer’s calculator for a java project

Tags: , , ,



I want to get access to the user’s computer’s calculator in my java project by clicking a button. If the method for that button is:

public void btnCalculaterOnAction(ActionEvent actionEvent) throws IOException {
        
    } 

Anyone can help me with what should I do next.

Answer

You can use

java.lang.Runtime.getRuntime().exec("[path]c.exe");

To open the calculator. But beware: The only way that you can communicate with applications you open this way is through the Process streams: in/out/err (assuming calc is set up to communicate as such)



Source: stackoverflow