This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 108879 [details] Stack trace Our class extends ClonableTopComponent, we overridden getVisualRepresentation(). In that method we are just removing all components and adding again. Please see code below: public JComponent getVisualRepresentation() { if( haveXmlErrors ) { jpanel.removeAll(); jpanel.setLayout( new BorderLayout() ); jpanel.add( errorUi, BorderLayout.CENTER ); return jpanel; } jpanel.removeAll(); jpanel.setLayout( new BorderLayout() ); jpanel.add( ( JComponent )ui, BorderLayout.CENTER ); return jpanel; } It is causing stack overflow error. Please find attached stack trace.
you must move the jpanel modifications out of the getVisualRepresentation() method. that method should just return the jpanel instance without any other changes to component hierarchy. multiview window has a custom focus traversal policy which calls this method frequently. changes in component hierarchy fire changes in focus manager which asks for visual representation component which leads to stack overflow. the best place to change multiview content are MultiViewElement.componentOpened() and MultiViewElement.componentShowing() methods.
Thanks Issue fixed, Thanks alot.