R
R
Rishat Sultanov2017-02-02 10:48:17
Java
Rishat Sultanov, 2017-02-02 10:48:17

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);
        }
    }

These files lie next to the main file. Also included in the project.
But I don't see the action. The buttons are silent.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
neu3y, 2017-09-03
@neu3y

In search
There is already an answer.
Just 3 days ago given.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question