How come my program stays in the wait(); state on line 74 and never moves on I have to manually exit the application. Here is my code
import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Arrays; import java.util.*; import java.util.concurrent.locks.*; import java.io.*; import java.util.Random; import java.beans.*; import javax.swing.border.Border; import javax.swing.ImageIcon; public class PatchIt extends JFrame { private JButton SCCM; private JButton Patches; private JButton Start; private JButton Exit; private ImageIcon logo; private JLabel icon; private JProgressBar progress = new JProgressBar(); private int sleepTime; private boolean isReady = true; private final static Random generator = new Random(); public PatchIt() { super("Patch It UP By SrA Aaron Horan & SSgt Christopher Barrow"); setLayout(new FlowLayout()); logo = new ImageIcon("bisstrip.jpg"); icon = new JLabel (logo); SCCM = new JButton("SCCM"); SCCM.setToolTipText("This button will uninstall and reinstall Configuration manager"); Patches = new JButton("Patches"); sleepTime = generator.nextInt( 180000 ); add(SCCM, BorderLayout.NORTH); add(icon, BorderLayout.CENTER ); add(Patches, BorderLayout.SOUTH); ButtonHandler handler = new ButtonHandler(); SCCM.addActionListener(handler); } private class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent event) { if(event.getSource() == SCCM) { synchronized(this) { try { Process EL = Runtime.getRuntime().exec("wscript C:\\Users\\1293714939A\\Desktop\\UAC.vbs"); try { wait(); } catch (InterruptedException exception ) { } } catch (IOException b) { b.printStackTrace(); } } synchronized(this) { try { Process B = Runtime.getRuntime().exec("wscript C:\\Users\\1293714939A\\Desktop\\calctest.vbe"); notify(); } catch (IOException b) { b.printStackTrace(); } } } } } public static void main (String [] args) { PatchIt run = new PatchIt(); run.setSize(950,780); run.setVisible(true); run.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE ); } }