public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("OK")){
        	int plotHeight = 0;
        	int plotWidth = 0;
        	
        	try {
        		plotHeight = Integer.parseInt(heightField.getText());
            	plotWidth = Integer.parseInt(widthField.getText());
        	} catch (NumberFormatException nfe){
        		JOptionPane.showMessageDialog(this, "Dimentions must be numerical values");
        	} 
        	
        	if(plotHeight > 0 && plotWidth > 0) {
        		gp.setPlotHeight(plotHeight);
        		gp.setPlotWidth(plotWidth);
        		gp.setPlotAreaSize();
        		gp.refreshPlot();
        		this.dispose();
        	} else {
        		JOptionPane.showMessageDialog(this, "Dimentions must be greater than 0");
        	}
        	
        } else if (e.getActionCommand().equals("Cancel")){
        	this.dispose();
        }
    }