void () { if (myFullScreenPopup != null) { myFullScreenPopup.cancel(); } if (myShowFullContent) { return; } List<BufferedImage> images; int current; Object showState; synchronized (myLock) { if (ContainerUtil.isEmpty(myImages)) { return; } images = myImages; current = myCurrentImage; showState = myShowState; } PluginImagesComponent component = new PluginImagesComponent(images, current); JPanel panel = new Wrapper(component); panel.setPreferredSize(getGraphicsConfiguration().getBounds().getSize()); myFullScreenPopup = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, component).createPopup(); component.myFullScreenPopup = myFullScreenPopup; component.myShowState = showState; myFullScreenPopup.addListener(new JBPopupListener() { @Override public void beforeShown(@NotNull LightweightWindowEvent event) { Window window = SwingUtilities.getWindowAncestor(event.asPopup().getContent()); window.setBackground(Gray.TRANSPARENT); window.setOpacity(0.95f); } @Override public void onClosed(@NotNull LightweightWindowEvent event) { myFullScreenPopup = null; synchronized (myLock) { if (myShowState == component.myShowState && component.myCurrentImage != myCurrentImage) { myCurrentImage = component.myCurrentImage; } } repaint(); } }); myFullScreenPopup.showInScreenCoordinates(this, new Point()); }