@Override
	public void paint(Graphics g) {
		bufferGraphics.clearRect(0, 0, X, Y);
		try {
			drawFrame(bufferGraphics);
			drawAxes(bufferGraphics);
			if (!func.equals("")) {
				if (check_func)
					drawCurve(bufferGraphics, func, Color.red);
				if (check_int)
					drawArea(bufferGraphics, func);
				if (check_der)
					drawTangent(bufferGraphics, func);

			}
			if (hit_check && !gremoved)
				drawHit(bufferGraphics);
			if (check_rel)
				drawRelation(bufferGraphics, rel_LHS, rel_RHS, Color.CYAN);
			if (check_pfunc) {
				start = Double.parseDouble(PP.a.getText());
				end = Double.parseDouble(PP.b.getText());
				System.out.println("Polar Curve");
				drawPolarCurve(bufferGraphics, Color.GREEN);
			}
		} catch (Exception e) {
		}
		g.drawImage(offscreen, 0, 0, this);
	}