JButton () { JButton button = new BasicArrowButton(SwingConstants.SOUTH) { @Override public Dimension getPreferredSize() { return ARROW_BUTTON_SIZE; } @Override public void paint(Graphics g) { // paint events may still arrive after UI switch until the entire UI is updated if (!LafManager.getInstance().getCurrentUIThemeLookAndFeel().getId().equals("win10Light")) { return; } Graphics2D g2 = (Graphics2D)g.create(); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); Rectangle outerRect = new Rectangle(getSize()); JBInsets.removeFrom(outerRect, JBUI.insets(1)); int bw = 1; Outline op = DarculaUIUtil.getOutline(comboBox); if (op != null) { op.setGraphicsColor(g2, hasFocus); bw = DarculaUIUtil.isTableCellEditor(comboBox) ? 1 : 2; } Rectangle innerRect = new Rectangle(outerRect); JBInsets.removeFrom(innerRect, JBUI.insets(bw)); // paint background if (comboBox.isEditable() && comboBox.isEnabled()) { if (isPressed() || popup.isVisible()) { g2.setColor(UIManager.getColor("Button.intellij.native.pressedBackgroundColor")); } else if (comboBox.hasFocus() || isHover()) { g2.setColor(UIManager.getColor("Button.intellij.native.focusedBackgroundColor")); } else { g2.setColor(getComboBackground(false)); } g2.fill(innerRect); } // paint border around button when combobox is editable if (comboBox.isEditable() && comboBox.isEnabled()) { Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(outerRect, false); border.append(innerRect, false); if (getModel().isPressed() || popup.isVisible()) { g2.setColor(UIManager.getColor("Button.intellij.native.pressedBorderColor")); g2.fill(border); } else if (comboBox.hasFocus() || isHover()) { g2.setColor(UIManager.getColor("Button.intellij.native.focusedBorderColor")); g2.fill(border); } } Icon icon = getArrowIcon(this); int x = JBUIScale.scale(5); int y = (getHeight() - icon.getIconHeight()) / 2; icon.paintIcon(this, g2, x, y); } finally { g2.dispose(); } } }; button.setOpaque(false); buttonReleaseListener = new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { if (!comboBox.isEditable()) { comboBox.repaint(); } } }; buttonHoverListener = new MouseHoverPropertyTrigger(comboBox, HOVER_PROPERTY); button.addMouseListener(buttonHoverListener); button.addMouseListener(buttonReleaseListener); return button; }