I know I can open cmd with this code
Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","start"});
but i want to create JButton for open cmd ,run command and show result in cmd screen(not console java) together.
ex. open cmd and run command "java -v" for check java version or "npm install"
my code
btnChkVersion.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//I DONT KNOW :(
}
});