当前位置: 首页>>代码示例>>Java>>正文


Java JComboBox.addPopupMenuListener方法代码示例

本文整理汇总了Java中javax.swing.JComboBox.addPopupMenuListener方法的典型用法代码示例。如果您正苦于以下问题:Java JComboBox.addPopupMenuListener方法的具体用法?Java JComboBox.addPopupMenuListener怎么用?Java JComboBox.addPopupMenuListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JComboBox的用法示例。


在下文中一共展示了JComboBox.addPopupMenuListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import javax.swing.JComboBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) {
    currentActiveItem = this;
    
    JComboBox combo = (JComboBox) ae.getSource();
    combo.setEditable(true);
    combo.getEditor().getEditorComponent().addFocusListener(this);
    combo.getEditor().getEditorComponent().addKeyListener(this);
    combo.addPopupMenuListener(this);
    combo.setSelectedItem(configName == null ? lastSelected + "1" : configName);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ConfigurationsComboModel.java

示例2: actionPerformed

import javax.swing.JComboBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) {
    JComboBox combo = (JComboBox) ae.getSource();
    combo.setEditable(true);
    combo.getEditor().getEditorComponent().addFocusListener(this);
    combo.getEditor().getEditorComponent().addKeyListener(this);
    combo.addPopupMenuListener(this);
    combo.setSelectedItem(configName == null ? lastSelected + "1" : configName);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ConfigurationsComboModel.java

示例3: DataComboBoxSupport

import javax.swing.JComboBox; //导入方法依赖的package包/类
/** Not private because used in tests. */
DataComboBoxSupport(JComboBox comboBox, DataComboBoxModel dataModel, boolean allowAdding) {
    this.dataModel = dataModel;
    this.allowAdding = allowAdding;
    
    comboBox.setEditable(false);

    comboBox.setModel(new ItemComboBoxModel());

    comboBox.setRenderer(new ItemListCellRenderer());
    comboBox.addActionListener(new ItemActionListener());
    comboBox.addPopupMenuListener(new ItemPopupMenuListener());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:DataComboBoxSupport.java

示例4: subscribeActual

import javax.swing.JComboBox; //导入方法依赖的package包/类
@Override
protected void subscribeActual(Observer<? super PopupMenuEvent> observer) {
    JComboBox<?> w = widget;

    PopupMenuEventConsumer aec = new PopupMenuEventConsumer(observer, w);
    observer.onSubscribe(aec);

    w.addPopupMenuListener(aec);
    if (aec.get() == null) {
        aec.onDispose(w);
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Swing,代码行数:13,代码来源:PopupMenuEventObservable.java

示例5: createSaveBox

import javax.swing.JComboBox; //导入方法依赖的package包/类
protected Component createSaveBox() {
	save = new JComboBox(saveOptions);
	save.addActionListener(this);
	save.addItemListener(this);
	save.addPopupMenuListener(this);
	save.setActionCommand("save");
	return save;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:9,代码来源:CustomDB.java

示例6: createSelectBox

import javax.swing.JComboBox; //导入方法依赖的package包/类
protected Component createSelectBox() {
	box = new JComboBox();
	box.addActionListener(this);
	box.addItemListener(this);
	box.addPopupMenuListener(this);
	box.setActionCommand("select");
	return box;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:9,代码来源:CustomDB.java


注:本文中的javax.swing.JComboBox.addPopupMenuListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。