internalFrame.addInternalFrameListener(internalFrameAdapter = new InternalFrameAdapter() {
public void internalFrameClosed(InternalFrameEvent e) {
contentManager.removeContent(content);
}
});
internalFrame.addVetoableChangeListener(vetoableChangeListener = new VetoableChangeListener() {
public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
if (JInternalFrame.IS_CLOSED_PROPERTY.equals(evt.getPropertyName())) {
if (Boolean.TRUE.equals(evt.getNewValue())) {
if (!myDoggyContentManagerUI.fireContentUIRemoving(content.getContentUI()))
throw new PropertyVetoException("Cannot remove.", evt);