private void initApplication() {
        

        String file = "";
        try {    
            file = JOptionPane.showInputDialog(this, "Plase provide a parking "
                    + "lot file to read (csv). If left empty parking.csv will "
                    + "be read.", "Parking Lot Simulator", 
                    JOptionPane.QUESTION_MESSAGE);
            /* If user selects cancel */
            if (file == null) System.exit(0); 
            if (file.equals("")) file = "parking.csv";
            matrix = MatrixUtil.readMatrix("maps/" + file);
            /* Initiate the central logic of the Sensor Netork and pass the reference */
            central = new Central(matrix, this);
            /* Initiate the thread that receive the messages of the real sensor */
            Thread threadReceptor = new MessageReceptor(central);
            threadReceptor.start();
        } catch (FileNotFoundException fnfe) {
            JOptionPane.showMessageDialog(this, 
                    "The file " + file + " could not be found", "Error", 
                    JOptionPane.ERROR_MESSAGE);
            System.exit(1);
        } catch (IOException ioe) {
            JOptionPane.showMessageDialog(this, 
                    "There was an I/O error while reading file: " + ioe.getMessage(), 
                    "Error" + ioe.getMessage(), JOptionPane.ERROR_MESSAGE);
            System.exit(1);
        }
        
        /* Create the parkign lot canvas and add it */
        canvas = new ParkingCanvas(matrix);
        canvas.setBackground(new Color(102, 102, 102));
        canvas.modifySize(pnlParking.getWidth() - 5, pnlParking.getHeight() - 5);
        canvas.setLayout(null);
        canvas.setLocation(2, 2);
        pnlParking.add(canvas);
        

        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                if (matrix[i][j] instanceof VirtualSensor) {
                    VirtualSensor vsensor = (VirtualSensor) matrix[i][j];
                    vsensor.setCentral(central);
                }
                if (matrix[i][j] instanceof RealSensor) {
                    RealSensor rsensor = (RealSensor) matrix[i][j];
                    rsensor.setCentral(central);
                }

            }
        }
        
        /* Disable certain GUI elements until appropiate */
        reloadSensorProperties();
        /* Set the value for available spaces and cars circulating */
        refreshState();
        /* Instantiate the random simulator but do not run it */
        randomSimulator = new RandomSimulator(central);
    }