JComponent () { final PackagesNotificationPanel notificationsArea = new PyPackagesNotificationPanel(); final JComponent notificationsComponent = notificationsArea.getComponent(); JPanel panel = new JPanel(new BorderLayout()); panel.add(notificationsComponent, BorderLayout.SOUTH); PyInstalledPackagesPanel packagesPanel = new PyInstalledPackagesPanel(myProject, notificationsArea); panel.add(packagesPanel, BorderLayout.CENTER); packagesPanel.addAncestorListener( new AncestorListenerAdapter() { @Override public void ancestorAdded(AncestorEvent event) { packagesPanel.updatePackages(PyPackageManagers.getInstance().getManagementService(myProject, mySdk)); packagesPanel.updateNotifications(mySdk); packagesPanel.removeAncestorListener(this); } } ); return panel; }