void (@NotNull AnActionEvent anActionEvent) { Window activeFrame = IdeFrameImpl.getActiveFrame(); if (activeFrame == null) { return; } Rectangle bounds = activeFrame.getGraphicsConfiguration().getBounds(); String _USR_SCALE_DESC = getUsrScaleDesc().replace("$LABEL_FONT_SIZE", "" + StartupUiUtil.getLabelFont().getSize()); String[] columns = new String[]{ "Property", "Value", "Description" }; String[][] data = new String[][]{ {JRE_HIDPI_MODE_TEXT, ENABLED ? "enabled" : "disabled", "<html><span style='font-size:x-small'>When enabled, the IDE UI scaling honors per-monitor DPI.<br>" + (SystemInfo.isWindows ? "To " + (ENABLED ? "disable" : "enable") + " set the JVM option <code>-Dsun.java2d.uiScale.enabled=" + (ENABLED ? "false" : "true") + "</code> and restart.</span></html>" : "The mode can not be changed on this platform.")}, {MONITOR_RESOLUTION_TEXT, "" + bounds.width + "x" + bounds.height, "<html><span style='font-size:x-small'>" + (ENABLED ? "The current monitor resolution" : "The main monitor resolution") + " (in user space).</span></html>"}, {SYS_SCALE_TEXT, "" + JBUIScale.sysScale(activeFrame), "<html><span style='font-size:x-small'>" + (ENABLED ? "The current monitor scale factor" : "The main monitor scale factor") + ".</span></html>"}, {USR_SCALE_TEXT, "" + JBUIScale.scale(1f), _USR_SCALE_DESC}, }; if (SystemInfo.isLinux && SystemInfo.isJetBrainsJvm) { try { Class<?> cls = Class.forName("sun.awt.X11GraphicsDevice"); MethodInvocator getDpiInfo = new MethodInvocator(cls, "getDpiInfo"); if (getDpiInfo.isAvailable()) { GraphicsDevice gd = null; try { gd = activeFrame.getGraphicsConfiguration().getDevice(); String[][] dpiInfo = (String[][])getDpiInfo.invoke(gd); if (dpiInfo != null && dpiInfo.length > 0) { for (String[] row : dpiInfo) { row[2] = "<html><span style='font-size:x-small'>" + row[2] + "</span></html>"; } String[][] _exData = new String[data.length + dpiInfo.length][]; System.arraycopy(data, 0, _exData, 0, data.length); System.arraycopy(dpiInfo, 0, _exData, data.length, dpiInfo.length); data = _exData; } } catch (IllegalArgumentException e) { Logger.getInstance(HidpiInfo.class).warn("Unexpected GraphicsDevice type (value): " + (gd != null ? gd.getClass().getName() : "null")); } } } catch (ClassNotFoundException ignore) { } } final String[][] exData = data; JTable table = new JTable(exData, columns) { @Override public TableCellRenderer getCellRenderer(int row, int column) { return (table1, value, isSelected, hasFocus, row1, column1) -> label(exData[row1][column1]); } @Override public boolean isCellEditable(int row, int column) { return false; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (myDrawCopyIcon) { Rectangle rect = getBounds(); g.setColor(JBColor.background()); g.fillRect(rect.width - myCopyIconPlateSize, rect.height - myCopyIconPlateSize, myCopyIconPlateSize, myCopyIconPlateSize); int offset = (myCopyIconPlateSize + myCopyIconSize) / 2; AllIcons.General.CopyHovered.paintIcon(this, g, rect.width - offset, rect.height - offset); } } }; final Supplier<Rectangle> getCopyIconRect = () -> { if (myCopyIconRect == null) { myCopyIconRect = table.getBounds(); myCopyIconRect.x = myCopyIconRect.width - myCopyIconPlateSize; myCopyIconRect.y = myCopyIconRect.height - myCopyIconPlateSize; myCopyIconRect.width = myCopyIconRect.height = myCopyIconPlateSize; } return myCopyIconRect; }; final String[][] _data = data; table.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { myDrawCopyIcon = true; table.repaint(getCopyIconRect.get()); } @Override public void mouseExited(MouseEvent e) { myDrawCopyIcon = false; table.repaint(getCopyIconRect.get()); } @Override public void mouseClicked(MouseEvent e) { if (myIsCopyIconActive) { StringBuilder builder = new StringBuilder(); for (String[] datum : _data) { builder.append(datum[0]).append(" : ").append(datum[1]).append("\n"); } try { CopyPasteManager.getInstance().setContents(new StringSelection(builder.toString())); } catch (Exception ignore) {} popup.cancel(); } } }); table.addMouseMotionListener(new MouseAdapter() { @Override public void mouseMoved(MouseEvent e) { if (getCopyIconRect.get().contains(e.getPoint())) { myIsCopyIconActive = true; table.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } else { myIsCopyIconActive = false; table.setCursor(Cursor.getDefaultCursor()); } } }); BiFunction<Integer, Integer, Dimension> size = (row, col) -> label(exData[row][col]).getPreferredSize(); int padding = JBUIScale.scale(10); table.setColumnSelectionAllowed(true); TableColumnModel tcm = table.getColumnModel(); tcm.getColumn(0).setPreferredWidth(size.apply(0, 0).width + padding); tcm.getColumn(1).setPreferredWidth(size.apply(1, 1).width + padding); tcm.getColumn(2).setPreferredWidth(size.apply(0, 2).width + padding); for (int i = 0; i < table.getRowCount(); i++) { table.setRowHeight(i, size.apply(0, 2).height); } JPanel tablePanel = new JPanel(new BorderLayout()); tablePanel.add(table, BorderLayout.CENTER); tablePanel.add(table.getTableHeader(), BorderLayout.NORTH); popup = JBPopupFactory. getInstance(). createComponentPopupBuilder(tablePanel, null). setTitle("HiDPI Info"). createPopup(); popup.showInCenterOf(activeFrame); }