package example;
//-*- mode:java; encoding:utf8n; coding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;

public class MainPanel extends JPanel {
    public MainPanel() {
        super(new BorderLayout());

        JPanel p = new JPanel(new BorderLayout(5, 5));
        p.add(new JLabel("JLabel:"), BorderLayout.WEST);
        p.add(new JTextField("JTextField"));
        p.setBorder(BorderFactory.createTitledBorder("JLabel+JTextFeild"));

        JPanel panel = new JPanel(new BorderLayout(25, 25));
        panel.add(makePanel(), BorderLayout.NORTH);
        panel.add(p, BorderLayout.SOUTH);
        panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        add(panel, BorderLayout.NORTH);
        setPreferredSize(new Dimension(320, 200));
    }
    @SuppressWarnings("unchecked")
    private static JPanel makePanel() {
        JPanel p = new JPanel(new BorderLayout(5, 5));
        p.add(makeComboBox(new String[] {"aaaa", "bbbbbbbbbb", "ccccc"}));

        UIManager.put("ComboBox.squareButton", Boolean.FALSE);
        UIManager.put("ComboBox.background", new Color(0,0,0,0)); //p.getBackground());
        Object[] items = {"JComboBox 11111:", "JComboBox 222:", "JComboBox 33:"};
        JComboBox comboBox = makeComboBox(items);
        final ListCellRenderer r = comboBox.getRenderer();
        comboBox.setRenderer(new ListCellRenderer() {
            @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                Component c = r.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                ((JLabel)c).setHorizontalAlignment(SwingConstants.RIGHT);
                return c;
            }
        });
        comboBox.setUI(new BasicComboBoxUI() {
            @Override protected JButton createArrowButton() {
                JButton button = new JButton(); //.createArrowButton();
                button.setBorder(BorderFactory.createEmptyBorder());
                button.setVisible(false);
                return button;
            }
        });
        comboBox.setOpaque(false);
        //comboBox.setBackground(p.getBackground());
        comboBox.setBorder(BorderFactory.createEmptyBorder(0,2,0,2));
        comboBox.setFocusable(false);

        p.add(comboBox, BorderLayout.WEST);
        p.setBorder(BorderFactory.createTitledBorder("JComboBox+JComboBox"));
        return p;
    }
    @SuppressWarnings("unchecked")
    private static JComboBox makeComboBox(Object[] model) {
        return new JComboBox(model);
    }
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e) {
            e.printStackTrace();
        }
//         UIManager.put("ComboBox.selectionForeground", new ColorUIResource(Color.BLUE));
//         UIManager.put("ComboBox.selectionBackground", new ColorUIResource(Color.WHITE));

        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

@@ -933,32 +933,38 @@
 nel() %7B%0A        
+final 
 JPanel p = new J
@@ -1066,24 +1066,93 @@
 ccccc%22%7D));%0A%0A
+        final Color bgc = UIManager.getColor(%22ComboBox.background%22);%0A
         UIMa
@@ -1251,31 +1251,10 @@
 d%22, 
-new Color(0,0,0,0)); //
+  
 p.ge
@@ -1683,22 +1683,27 @@
     
-Component c = 
+JLabel c = (JLabel)
 r.ge
@@ -1796,19 +1796,9 @@
     
-((JLabel)c)
+c
 .set
@@ -1836,24 +1836,335 @@
 nts.RIGHT);%0A
+                if(isSelected) %7B%0A                    c.setForeground(list.getSelectionForeground());%0A                    c.setBackground(list.getSelectionBackground());%0A                %7Delse%7B%0A                    c.setForeground(list.getForeground());%0A                    c.setBackground(bgc);%0A                %7D%0A
             

Change ComboBox.background