public void addNotify() { super.addNotify(); scene.addSceneListener(this); JComponent viewComponent = scene.getView(); if (viewComponent == null) { viewComponent = scene.createView(); } viewComponent.addComponentListener(this); repaint(); }