void (Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D)g.create(); Rectangle r = new Rectangle(c.getSize()); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); g2.translate(r.x, r.y); Object value = comboBox.getSelectedItem(); Color coloredItemColor = value instanceof ColoredItem ? ((ColoredItem)value).getColor() : null; boolean editable = comboBox.isEnabled() && editor != null && comboBox.isEditable(); Color bg = comboBox.getBackground(); Color background = editable ? editor.getBackground() : ObjectUtils.notNull(coloredItemColor, comboBox.isBackgroundSet() && !(bg instanceof UIResource) ? bg : comboBox.isEnabled() ? UIManager.getColor("ComboBox.background") : UIUtil.getComboBoxDisabledBackground()); g2.setColor(background); float arc = comboBox.isEditable() ? 0 : ARC.getFloat(); float bw = BW.getFloat(); Area bgs = new Area(new RoundRectangle2D.Float(bw, bw, r.width - bw * 2, r.height - bw * 2, arc, arc)); bgs.subtract(new Area(arrowButton.getBounds())); g2.fill(bgs); } finally { g2.dispose(); } if (!comboBox.isEditable()) { listBox.setForeground(comboBox.isEnabled() ? UIManager.getColor("Label.foreground") : UIManager.getColor("Label.disabledForeground")); checkFocus(); paintCurrentValue(g, rectangleForCurrentValue(), hasFocus); } }