Here you can find the source of comboBoxScroll(JComboBox box)
public static void comboBoxScroll(JComboBox box)
//package com.java2s; //License from project: Open Source License import javax.swing.JComboBox; import javax.swing.JPopupMenu; import javax.swing.JScrollBar; import javax.swing.JScrollPane; public class Main { public static void comboBoxScroll(JComboBox box) { if (box == null) { return; }/*from w w w . j a v a 2 s . co m*/ Object comp = box.getUI().getAccessibleChild(box, 0); if (!(comp instanceof JPopupMenu)) { return; } JPopupMenu popup = (JPopupMenu) comp; final JScrollPane scrollPane = (JScrollPane) popup.getComponent(0); scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); } }