if (checkBox.isSelected()) {
            final int y1 = (height / 2) - (onImage.getHeight(null) / 2);
            g2.drawImage(onImage, 0, y1, null);
        } else {