void () { component = new MyComponent(myContent, this, myShadowBorderProvider != null ? null : myShowPointer ? myPosition.createBorder(this) : getPointlessBorder()); if (myActionProvider == null) { final Consumer<MouseEvent> listener = event -> { SwingUtilities.invokeLater(() -> hide()); }; myActionProvider = new ActionProvider() { private ActionButton myCloseButton; @Override public @NotNull List<ActionButton> createActions() { myCloseButton = new CloseButton(listener); return Collections.singletonList(myCloseButton); } @Override public void layout(@NotNull Rectangle lpBounds) { if (myCloseButton == null || !myCloseButton.isVisible()) { return; } Icon icon = getCloseButton(); int iconWidth = icon.getIconWidth(); int iconHeight = icon.getIconHeight(); Insets borderInsets = getShadowBorderInsets(); myCloseButton.setBounds(lpBounds.x + lpBounds.width - iconWidth - borderInsets.right - JBUIScale.scale(8), lpBounds.y + borderInsets.top + JBUIScale.scale(6), iconWidth, iconHeight); } }; } component.clear(); component.myAlpha = isAnimationEnabled() ? 0f : -1; createComponentBorder(); myLayeredPane.add(component); if (myZeroPositionInLayer) { myLayeredPane.setLayer(component, getLayer(), 0); // the second balloon must be over the first one } myPosition.updateBounds(this); PopupLocationTracker.register(this); if (myBlockClicks) { component.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { e.consume(); } @Override public void mousePressed(MouseEvent e) { e.consume(); } @Override public void mouseReleased(MouseEvent e) { e.consume(); } }); } MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(this); connection.subscribe(LafManagerListener.TOPIC, source -> updateComponent()); connection.subscribe(UISettingsListener.TOPIC, uiSettings -> updateComponent()); }