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

		Color dipcolor = new Color(33, 49, 255);
		Color pincolor = Color.lightGray;
		Color slidecolor = new Color(0, 0, 120);
		Color switchcolor = Color.lightGray;

		if (this.circuit.selected == this) {
			dipcolor = Color.yellow;
			pincolor = Color.orange;
			slidecolor = Color.orange;
			switchcolor = Color.white;
		}

		g.setColor(dipcolor);
		g.fillRect(0, 4, this.getWidth() - 1, this.getHeight() - 9);

		g.setColor(pincolor);
		for (int i = 0; i < this.pins; i++) {
			g.fillRect(i * 8 + 1, 2, 5, 2);
			g.fillRect(i * 8 + 1, 27, 5, 2);
		}

		g.setColor(slidecolor);
		for (int i = 0; i < this.pins; i++) {
			g.fillRect(i * 8 + 1, 8, 5, 14);
		}

		g.setColor(switchcolor);
		for (int i = 0; i < this.pins; i++) {
			if (this.states[i]) {
				g.fillRect(i * 8 + 3, 9, 2, 6);
			} else {
				g.fillRect(i * 8 + 3, 15, 2, 6);
			}
		}
	}