當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。