@Override
    public void paint(Graphics g)
    {
        g.setColor(this.getBackground());
        g.fillRect(0, 0, this.getWidth(), this.getHeight());
        
        Color colBorder1, colBorder2, colBack1, colBack2, colSlider, colSliderBorder;
        
        if (this.isEnabled())
        {
            colBorder1 = new Color(50, 50, 50);
            colBorder2 = Color.BLACK;
            colBack1 = new Color(200, 200, 200);
            colBack2 = new Color(150, 150, 150);
            colSlider = new Color(210, 210, 210);
            colSliderBorder = new Color(100, 100, 100);
        }
        else
        {
            colBorder1 = new Color(120, 120, 120);
            colBorder2 = new Color(100, 100, 100);
            colBack1 = new Color(150, 150, 150);
            colBack2 = new Color(170, 170, 170);
            colSlider = new Color(140, 140, 140);
            colSliderBorder = new Color(100, 100, 100);
        }
        
        int tx = 5;
        int ty = 7;
        
        Graphics2D g2d = (Graphics2D) g;
        
        int drawWidth = this.getWidth() - 10;
        int drawHeight = this.getHeight() - 14;
        
        g2d.setColor(colBorder1);
        g2d.draw3DRect(tx - 2, ty - 2, drawWidth + 3, drawHeight + 3, false);
        g2d.setColor(colBorder2);
        g2d.draw3DRect(tx - 1, ty - 1, drawWidth + 1, drawHeight + 1, false);
        
        int steps = max - min + 1;
        
        for (int i = 0; i < steps; i += groupSize)
        {
            if (i / groupSize % 2 == 0)
            {
                g2d.setColor(colBack1);
            }
            else
            {
                g2d.setColor(colBack2);
            }
            
            int     x = drawWidth * i / steps;
            int width = drawWidth * Math.min(i + groupSize, max) / steps - x;
            
            g2d.fillRect(tx + x, ty, width, drawHeight);
        }
        
        int v = value - min;
        int x  = drawWidth * v / steps;
        int x2 = drawWidth * (v + 1) / steps;
        x = (x + x2) / 2;
        
        g2d.setColor(colSlider);
        g2d.fill3DRect(tx + x - 4, 2, 8, this.getHeight() - 5, true);
        
        g2d.setColor(colSliderBorder);
        g2d.draw3DRect(tx + x - 5, 2, 9, this.getHeight() - 5, true);
    }