public void paintThumb(Graphics g) {
        if (hideThumb == true) {
            return;
        }
        Image img = thumbImage;
        if (img != null) {
            if (thumbPressedImage != null) {
                if (parentSlider.getValueIsAdjusting()) {
                    img = thumbPressedImage;
                }
            }
            if (newThumbHeight >= 0) {
                if (parentSlider.getOrientation() == JSlider.HORIZONTAL) {
                    g.drawImage(img, thumbRect.x + thumbXOffset, (parentSlider.getHeight() - img.getHeight(slider)) / 2, img.getWidth(null), newThumbHeight, null);
                } else {
                    g.drawImage(img, (parentSlider.getWidth() - img.getWidth(slider)) / 2, thumbRect.y + thumbYOffset, img.getWidth(null), newThumbHeight, null);
                }
            } else {
                if (parentSlider.getOrientation() == JSlider.HORIZONTAL) {
                    g.drawImage(img, thumbRect.x + thumbXOffset, (parentSlider.getHeight() - img.getHeight(slider)) / 2, img.getWidth(null), img.getHeight(null), null);
                } else {
                    g.drawImage(img, (parentSlider.getWidth() - img.getWidth(slider)) / 2, thumbRect.y + thumbYOffset, img.getWidth(null), img.getHeight(null), null);
                }
            }
        }
    }