1 7 8 package javax.swing.plaf.synth; 9 10 import javax.swing.*; 11 import javax.swing.event.*; 12 import javax.swing.plaf.basic.*; 13 import java.awt.*; 14 import java.awt.event.*; 15 import java.beans.PropertyChangeListener ; 16 import java.beans.PropertyChangeEvent ; 17 import java.io.Serializable ; 18 19 20 26 class SynthComboPopup extends BasicComboPopup { 27 public SynthComboPopup( JComboBox combo ) { 28 super(combo); 29 } 30 31 38 protected void configureList() { 39 list.setFont( comboBox.getFont() ); 40 list.setCellRenderer( comboBox.getRenderer() ); 41 list.setFocusable( false ); 42 list.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); 43 int selectedIndex = comboBox.getSelectedIndex(); 44 if ( selectedIndex == -1 ) { 45 list.clearSelection(); 46 } 47 else { 48 list.setSelectedIndex( selectedIndex ); 49 list.ensureIndexIsVisible( selectedIndex ); 50 } 51 installListListeners(); 52 } 53 } 54 | Popular Tags |