@Override
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		Graphics2D g2d = (Graphics2D) g;

		// Translate the coordinate system
		g2d.translate(this.getWidth() / 2, this.getHeight() / 2);

		Body[] bodies = this.cluster.getBodies();
		int numBodies = bodies.length;
		Point2D.Double[] pointArray = new Point2D.Double[numBodies];

		// Paint each body
		for (int i = 0; i < numBodies; i++)
		{
			SpaceVector position = bodies[i].getPosition();
			double[] components = position.getComponents();
			double x = components[0];
			double y = components[1];
			double diameter = bodies[i].getDiameter();

			// This ArrayList keeps track of the position of the body at fixed intervals to
			// paint the motion path
			pointArray[i] = new Point2D.Double(x, -y);

			// Paint the body
			g2d.setColor(bodies[i].getColor());
			g2d.fill(new Ellipse2D.Double(x - diameter / 2, -y - diameter / 2, diameter, diameter));

			// Remove earlier points from the ArrayList
			if (this.points.size() > this.MAX_TRACE_POINTS)
			{
				points.remove(0);
			}

			// Create a GeneralPath that passes through each point in the ArrayList
			if (this.showPaths && points.size() >= 2)
			{
				GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, this.points.size());
				path.moveTo(this.points.get(0)[i].getX(), this.points.get(0)[i].getY());

				for (int j = 1; j < this.points.size(); j++)
				{
					path.lineTo(this.points.get(j)[i].getX(), this.points.get(j)[i].getY());
				}

				g2d.draw(path);
			}

			// Create a light border around the body
			g2d.setColor(Color.LIGHT_GRAY);
			g2d.draw(new Ellipse2D.Double(x - diameter / 2, -y - diameter / 2, diameter, diameter));
		}

		// Add the array corresponding to the locations of each body to the ArrayList
		this.points.add(pointArray);
	}