@Override
        public void paintBorder(Graphics g) {

            if (paintBorder) {

                Graphics2D g2 = (Graphics2D) g.create();

                g2.setPaint(color);
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON);
                Area area = new Area(shape);
                for (int i = 1; i <= thickness; i++) {
                    float scaleI;
                    scaleI = ((float) i) / thickness;
                    if (i == pVal || i == pVal - 1 || i == pVal + 1) {
                        g2.setComposite(AlphaComposite.getInstance(
                                AlphaComposite.SRC_OVER));
                    } else {
                        g2.setComposite(AlphaComposite.getInstance(
                                AlphaComposite.SRC_OVER, scaleI * pVal / thickness));
                    }

                    AffineTransform trans = new AffineTransform();
                    float scaleS = scaleI * left + scale;
                    trans.scale(scaleS, scaleS);
                    trans.translate(thickness - i, thickness - i);
                    Area drawArea = area.createTransformedArea(trans);
                    g2.draw(drawArea);

                }
                if (pTimer.isRunning() && ++pVal == thickness) {
                    pTimer.stop();
                }

                g2.dispose();
            }
        }