Trevor,
the folowing class could be uses a general component interceptor. You'll need to provide your own implmentation of the postProcessComponent(JComponent comp) method:
Code:
public abstract class ComponentInterceptor implements AWTEventListener {
public ComponentInterceptor() {
Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.CONTAINER_EVENT_MASK);
}
public abstract void postProcessComponent(JComponent comp);
public void eventDispatched(AWTEvent e) {
if (e.getSource() instanceof JComponent) {
JComponent comp = (JComponent) e.getSource();
if (comp.getClientProperty("intercepted") == null) {
comp.putClientProperty("intercepted", Boolean.TRUE);
postProcessComponent(comp);
}
}
}
}
Ollie