@Override
	public void actionPerformed(ActionEvent a) {
		if(a.getSource() == btnPlot){
			String function = this.txtFunction.getText();
			String start = this.txtStart.getText();
			String end = this.txtEnd.getText();
			String xTicks = this.txtXTicks.getText();
			String yTicks = this.txtYTicks.getText();
			
			if(!function.isEmpty()){
				this.pFrame.setExpression(function);
				if (!start.isEmpty() && !end.isEmpty()) {
					this.pFrame.setInterval(Double.parseDouble(start),
							Double.parseDouble(end));
					if(!xTicks.isEmpty())
						this.pFrame.setNumTicksX(Integer.parseInt(xTicks));
					if(!yTicks.isEmpty())
						this.pFrame.setNumTicksY(Integer.parseInt(yTicks));
				}
			}
			this.pFrame.plot();
			this.setVisible(false);
		} else {
			if (this.cmbTrig.getSelectedIndex() == 0)
				this.pFrame.setIsRadian(false);
			if (this.cmbTrig.getSelectedIndex() == 1)
				this.pFrame.setIsRadian(true);
		}
	}