Answer the question
In order to leave comments, you need to log in
How to handle action on button click?
Good afternoon, ladies and gentlemen.
There are 2 buttons in the Jframe
which should run other Jar files.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Process proc = Runtime.getRuntime().exec("java -jar Park.jar");
} catch (IOException ex) {
Logger.getLogger(QUITravel.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Process proc = Runtime.getRuntime().exec("java -jar Road.jar");
} catch (IOException ex) {
Logger.getLogger(QUITravel.class.getName()).log(Level.SEVERE, null, ex);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question