synthcombopopup.java

来自「JAVA 所有包」· Java 代码 · 共 54 行

JAVA
54
字号
/* * @(#)SynthComboPopup.java	1.8 05/11/17 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.synth;import javax.swing.*;import javax.swing.event.*;import javax.swing.plaf.basic.*;import java.awt.*;import java.awt.event.*;import java.beans.PropertyChangeListener;import java.beans.PropertyChangeEvent;import java.io.Serializable;/** * Synth's ComboPopup. * * @version 1.8, 11/17/05 * @author Scott Violet */class SynthComboPopup extends BasicComboPopup {    public SynthComboPopup( JComboBox combo ) {        super(combo);    }    /**     * Configures the list which is used to hold the combo box items in the     * popup. This method is called when the UI class     * is created.     *     * @see #createList     */    protected void configureList() {        list.setFont( comboBox.getFont() );        list.setCellRenderer( comboBox.getRenderer() );        list.setFocusable( false );        list.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );        int selectedIndex = comboBox.getSelectedIndex();        if ( selectedIndex == -1 ) {            list.clearSelection();        }        else {            list.setSelectedIndex( selectedIndex );	    list.ensureIndexIsVisible( selectedIndex );        }        installListListeners();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?