public static void main(String[] args) throws InvocationTargetException, InterruptedException, IOException {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                new SoftPanelUI().setVisible(true);
            }
        });
        
        // Create the control objects
        setInitControlStates();
        
        // Get the Power Plant Simulator's IP address from user.
      //  byte[] address = getServerAddress();

        // Establish connection with Power Plant simulator.
     //   clientCon = new UDPClient(InetAddress.getByAddress(address));
        /*
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
        	int transmission = 1;
     	   @Override
     	   public void run() {
     		   try {
				clientCon.transmit("message: " + Integer.toString(transmission) + "|");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
     		   transmission++;
     	   }
        }, 1000, 5000);
        */
        
        /**
         * Saves the state of the control panel at shut down time.
         */
        Runtime.getRuntime().addShutdownHook(new Thread() {
        	
        	@Override
        	public void run() {
        		// Save the control states to "controls.txt"
        		BufferedWriter writer = null;
        		try {
					writer = new BufferedWriter(new FileWriter("controls.txt"));
					
					// Write LED statuses
					for (int i=0; i<3; i++)
						for (int j=0; j<12; j++)
							writer.write(ledArray[i][j].getStatus() + " ");
					
					writer.write("\r\n"); // New line
					
					// Write gauge statuses
					for (int i=0; i<24; i++) 
						writer.write(gaugeArray[i].getPointerLocation() + " ");
					
					writer.write("\r\n"); // New line
					
					// Write switch states
					for (int i=0; i<25; i++)
						writer.write(switchArray[i].getStatus() + " ");
					
					writer.write("\r\n"); // New line
					
					// Write button states
					for (int i=0; i<24; i++)
						writer.write(buttonArray[i].getStatus() + " ");
					
					writer.write("\r\n"); // New line
					
				} catch (IOException e) {
					e.printStackTrace();
				} finally {
					try {
						// Close the writer
						writer.close();
					} catch (Exception e) {
					}
				}
        	}
        });

    }