public void update(Graphics g) {

		Graphics2D g2 = (Graphics2D) g;
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

		Dimension dim = getSize();
		width = dim.width;
		height = dim.height;
		xcen = width / 2;
		ycen = height / 2;
		xmin = width / 2 + (int) spacing;
		ymax = height - 20;

		double var6 = 0.0, var12 = 0.0;
		vr1.moveTo(xcen, 0);
		vr2.moveTo(xcen, 0);
		for (int i = 15; i < 75; i++) {
			var6 = (spacing / i);
			var6 = var6 * var6 * var6;
			var6 = var6 * var6;
			var12 = var6 * var6;
			vr1.lineTo(xcen + i, (float) (ycen * (1.0 - var12 + var6)));
			vr2.lineTo(xcen - i, (float) (ycen * (1.0 - var12 + var6)));
		}

		g2.setColor(Color.white);
		g2.fillRect(0, 0, width, height);

		g2.setColor(Color.lightGray);
		float radius = 2.0f;
		float diameter = radius + radius;
		int xgrid = (int) (width / spacing);
		int ygrid = (int) (height / spacing);
		for (int i = -xgrid; i < xgrid; i++) {
			for (int j = -ygrid; j < ygrid; j++) {
				if (xcen + i * spacing > radius && xcen + i * spacing < width - radius && ycen + j * spacing > radius
						&& ycen + j * spacing < height - radius) {
					g2.fillOval((int) (xcen + i * spacing - radius), (int) (ycen + j * spacing - radius),
							(int) diameter, (int) diameter);
				}
			}
		}

		g2.setColor(Color.gray);
		g2.fillRect((int) (xcen - spacing), 0, (int) (spacing + spacing), ycen);

		g2.setColor(Color.black);
		g2.drawLine(10, ycen, width - 10, ycen);
		g2.drawLine(xcen, 10, xcen, height - 10);
		g2.setColor(Color.gray);
		g2.draw(vr1);
		g2.draw(vr2);

		int r1 = (int) (rCutOff * spacing);
		int r2 = (int) (rList * spacing);
		diff = r2 - r1;
		rectx = r1 + xcen;
		recty = r2 + ycen;
		ctrl1.setLocation(rectx - 5, ycen - 5);
		ctrl2.setLocation(xcen - 5, recty - 5);
		circle1.setFrame(xcen - r1, ycen - r1, r1 + r1, r1 + r1);
		circle2.setFrame(xcen - r2, ycen - r2, r2 + r2, r2 + r2);

		g2.setColor(Color.black);
		g2.setStroke(thinStroke);
		g2.draw(circle1);
		g2.setStroke(dashed);
		g2.draw(circle2);

		g2.setColor(Color.red);
		g2.setStroke(thinStroke);
		g2.draw(ctrl1);
		g2.draw(ctrl2);

		g2.setFont(font);
		g2.setColor(Color.black);
		g2.drawString("Cutoff Radius = " + rCutOff + " x Atomic Radius", 20, height - 20);
		g2.drawString("Neighbor List Radius = " + rList + " x Atomic Radius", 20, height - 10);

	}