View Javadoc
1   package edu.jiangxin.apktoolbox.swing.extend.autocomplete;
2   
3   import javax.swing.*;
4   import javax.swing.plaf.basic.BasicComboBoxUI;
5   import javax.swing.plaf.basic.BasicComboPopup;
6   import javax.swing.plaf.basic.ComboPopup;
7   
8   class ScrollBasicComboBoxUI extends BasicComboBoxUI {
9       @Override
10      protected ComboPopup createPopup() {
11          return new BasicComboPopup(comboBox) {
12              private static final long serialVersionUID = 1L;
13  
14              @Override
15              protected JScrollPane createScroller() {
16                  return new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
17                          ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
18              }
19          };
20      }
21  
22  }