@Override
    public void paint(Graphics g) {
        g.setColor(Color.GRAY);
        g.fillRect(0, 0, getWidth(), getHeight());
        if (layerCount > 0) {
            int layer_size = Math.min(getHeight(), getWidth() / layerCount);
            for (int i = 0; i < layerCount; i++) {
                g.setColor(new Color(0, 125, 155, 200));
                g.fillRect(layer_size * i, 0, layer_size, layer_size);
                if (i == selected) {
                    g.setColor(Color.YELLOW);
                } else {
                    g.setColor(Color.BLACK);
                    if (displayed.get(i)) {
                        g.setColor(Color.RED);
                    }
                }
                g.drawRect(layer_size * i, 0, layer_size, layer_size);
            }
        }
        paintComponents(g);

    }