@Override
    public void paintBorder(Graphics g) {
        if (isSelected()) {
            if (mTimer != null) {
                mTimer.stop();
            }
            mFadeCount = mFadeLimit;
        } else {
            if (isRollover) {
                mFadeCount++;
                if (mFadeCount >= mFadeLimit) {
                    mFadeCount = mFadeLimit;
                    if (mTimer != null) {
                        mTimer.stop();
                    }
                }
            } else {
                if (mTimer != null) {
                    mTimer.stop();
                }
                return;
            }
        }

        int x = 0, y = 0;
        int w = getWidth(), h = getHeight();

        w--;
        h--;
        Graphics2D g2 = (Graphics2D) g.create();

        Point orig = new Point(x, y);
        g2.setPaint(mColor);
        float fade = ((float) mFadeCount) / mFadeLimit;

        for (int i = 0; i < thickness; i++) {
            float scale = ((float) i) / thickness;
            g2.setComposite(AlphaComposite.getInstance(
                    AlphaComposite.SRC_OVER, scale * fade));
            g2.drawRect(orig.x, orig.y, w, h);

            orig.x++;
            orig.y++;
            w -= 2;
            h -= 2;
        }
    }