private void updateDecorationPainterUnclippedBounds(JLayeredPane layeredPane, Point relativeLocationToOwner) {
        Rectangle decorationBoundsInLayeredPane;

        if (layeredPane == null) {
            decorationBoundsInLayeredPane = new Rectangle();
        } else {
            // Calculate location of the decorated component in the layered pane containing the decoration painter
            Point decoratedComponentLocationInLayeredPane = SwingUtilities.convertPoint(decoratedComponent.getParent
                    (), decoratedComponent.getLocation(), layeredPane);

            // Deduces the location of the decoration painter in the layered pane
            decorationBoundsInLayeredPane = new Rectangle(decoratedComponentLocationInLayeredPane.x +
                    relativeLocationToOwner.x, decoratedComponentLocationInLayeredPane.y + relativeLocationToOwner.y,
                    getWidth(), getHeight());
        }

        // Update decoration painter
        decorationPainter.setBounds(decorationBoundsInLayeredPane);
    }
private void updateDecorationPainterUnclippedBounds ( JLayeredPane layeredPane , Point relativeLocationToOwner ) { Rectangle decorationBoundsInLayeredPane ; if ( layeredPane == null ) { decorationBoundsInLayeredPane = new Rectangle ( ) ; } else { Point decoratedComponentLocationInLayeredPane = SwingUtilities . convertPoint ( decoratedComponent . getParent ( ) , decoratedComponent . getLocation ( ) , layeredPane ) ; decorationBoundsInLayeredPane = new Rectangle ( decoratedComponentLocationInLayeredPane . x + relativeLocationToOwner . x , decoratedComponentLocationInLayeredPane . y + relativeLocationToOwner . y , getWidth ( ) , getHeight ( ) ) ; } decorationPainter . setBounds ( decorationBoundsInLayeredPane ) ; }
Calculates and updates the unclipped bounds of the decoration painter in layered pane coordinates.

@param layeredPane             Layered pane containing the decoration painter.
@param relativeLocationToOwner Location of the decoration painter relatively to the decorated component.