Subject:   Limited application re GUI widgets
Date:   2003-02-07 02:24:04
From:   davidccrane
Good article, good pattern - I'm in the process of moving a project over to a Decorator-based architecture just now, pleased with how much more flexibility it offers.

By making the decorator a JComponent itself, you do limit the types of decoration you can add - the addition of a border is a special case because it can be drawn outside of the decorated component, ditto with the corner button. If I wanted to draw a cross through the centre of the component, say, I'd need to find another approach, override or intercept the decorated component's paint() method somehow. Any ideas on how this could be done?