javax.swing.JComboBox.addPopupMenuListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中javax.swing.JComboBox.addPopupMenuListener()方法的一些代码示例,展示了JComboBox.addPopupMenuListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.addPopupMenuListener()方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:addPopupMenuListener

JComboBox.addPopupMenuListener介绍

暂无

代码示例

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
 * Constructor specifying the source combobox that will trigger the validation.
 *
 * @param source                    Source combobox that will trigger the validation.
 * @param uncheckedExceptionHandler Handler for exceptions occurring when firing the trigger events.<br>
 *                                  If null, the default handler will be used.
 *
 * @see AbstractTrigger#AbstractTrigger(UncheckedExceptionHandler)
 */
public JComboBoxCanceledTrigger(JComboBox source, UncheckedExceptionHandler uncheckedExceptionHandler) {
  super(uncheckedExceptionHandler);
  this.source = source;
  source.addPopupMenuListener(sourceAdapter);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

public void addPopupMenuListener(PopupMenuListener l) {
  combo.addPopupMenuListener(l);
}

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
 * Constructor specifying the source combobox that will trigger the validation.
 *
 * @param source                    Source combobox that will trigger the validation.
 * @param uncheckedExceptionHandler Handler for exceptions occurring when firing the trigger events.<br>
 *                                  If null, the default handler will be used.
 *
 * @see AbstractTrigger#AbstractTrigger(UncheckedExceptionHandler)
 */
public JComboBoxClosedTrigger(JComboBox source, UncheckedExceptionHandler uncheckedExceptionHandler) {
  super(uncheckedExceptionHandler);
  this.source = source;
  source.addPopupMenuListener(sourceAdapter);
}

代码示例来源:origin: com.google.code.validationframework/validationframework-swing

/**
 * Constructor specifying the source combobox that will trigger the validation.
 *
 * @param source                    Source combobox that will trigger the validation.
 * @param uncheckedExceptionHandler Handler for exceptions occurring when firing the trigger events.<br>
 *                                  If null, the default handler will be used.
 *
 * @see AbstractTrigger#AbstractTrigger(UncheckedExceptionHandler)
 */
public JComboBoxOpenedTrigger(JComboBox source, UncheckedExceptionHandler uncheckedExceptionHandler) {
  super(uncheckedExceptionHandler);
  this.source = source;
  source.addPopupMenuListener(sourceAdapter);
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private JComboBox initCbo(final JComboBox cbo) {
 cbo.setEditable(false);
 setModel(cbo, NONE, INSTALL, REMOVE);
 
 cbo.addPopupMenuListener(new PopupMenuListener() {
    public void popupMenuCanceled(PopupMenuEvent e) {}
    public void popupMenuWillBecomeInvisible(PopupMenuEvent e){}
    public void popupMenuWillBecomeVisible(PopupMenuEvent e)
    {
      JComboBox source =(JComboBox) e.getSource();
      updateDataModel(source);
    }
 });
 
 return cbo;
}

代码示例来源:origin: xyz.cofe/gui.swing

component.addPopupMenuListener(ml);

代码示例来源:origin: xyz.cofe/gui.swing

component.addPopupMenuListener(ml);

代码示例来源:origin: realXuJiang/bigtable-sql

private JComboBox initCbo(final JComboBox cbo) {
 cbo.setEditable(false);
 setModel(cbo, NONE, INSTALL, REMOVE);
 
 cbo.addPopupMenuListener(new PopupMenuListener() {
    public void popupMenuCanceled(PopupMenuEvent e) {}
    public void popupMenuWillBecomeInvisible(PopupMenuEvent e){}
    public void popupMenuWillBecomeVisible(PopupMenuEvent e)
    {
      JComboBox source =(JComboBox) e.getSource();
      updateDataModel(source);
    }
 });
 
 return cbo;
}

代码示例来源:origin: stackoverflow.com

JComboBox comboBox = new JComboBox( items );
BoundsPopupMenuListener listener = new BoundsPopupMenuListener(true, false);
comboBox.addPopupMenuListener( listener );

代码示例来源:origin: xyz.cofe/gui.swing

component.addPopupMenuListener(ml);

代码示例来源:origin: stackoverflow.com

editor.addPopupMenuListener(new PopupMenuListener() {
  @Override
  public void popupMenuWillBecomeVisible(PopupMenuEvent e) {

代码示例来源:origin: stackoverflow.com

box.addItem("from start");
box.addPopupMenuListener(this);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

public CountLimitEditorComponent() {
  setLayout(new BorderLayout());
  comboBox = new JComboBox(sa);
  comboBox.setEditable(true);
  putClientProperty("JComboBox.isTableCellEditor", false); // NOI18N
  comboBox.setLightWeightPopupEnabled(false);
  comboBox.addActionListener(this);
  comboBox.addPopupMenuListener(this);
  add(comboBox, BorderLayout.CENTER);
}

代码示例来源:origin: stackoverflow.com

JComboBox<String> comboBox = new JComboBox<String>(labels);
comboBox.setMaximumRowCount(comboBox.getModel().getSize());
comboBox.addPopupMenuListener(new CustomComboBoxPopupMenuListener());

代码示例来源:origin: stackoverflow.com

c.addPopupMenuListener(new PopupMenuListener() {

代码示例来源:origin: stackoverflow.com

import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;

public class ComboBoxCellEditor extends DefaultCellEditor {

  public ComboBoxCellEditor(JComboBox comboBox) {
    super(comboBox);
    comboBox.addPopupMenuListener(new PopupMenuListener() {

      public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
      }

      public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
      }

      public void popupMenuCanceled(PopupMenuEvent e) {
        cancelCellEditing();
      }
    });
  }
}

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

combo.addPopupMenuListener(new PopupMenuListener() {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-wizards

public GUIRegistrationPanel(final WizardDescriptor setting, final DataModel data) {
  super(setting);
  this.data = data;
  initComponents();
  putClientProperty("NewFileWizard_Title", getMessage("LBL_ActionWizardTitle"));
  
  menu.addPopupMenuListener(new PML(menu, menuPosition));
  toolbar.addPopupMenuListener(new PML(toolbar, toolbarPosition));
  ftContentType.addPopupMenuListener(new PML(ftContentType, ftPosition));
  edContentType.addPopupMenuListener(new PML(edContentType, edPosition));
  gmiGroup = new JComponent[] {
    menu, menuTxt, menuPosition, menuPositionTxt, menuSeparatorAfter, menuSeparatorBefore
  };
  toolbarGroup = new JComponent[] {
    toolbar, toolbarTxt, toolbarPosition, toolbarPositionTxt
  };
  shortcutGroup = new JComponent[] {
    shortcutsList, keyStrokeTxt, keyStrokeChange, keyStrokeRemove
  };
  fileTypeGroup = new JComponent[] {
    ftContentType, ftContentTypeTxt, ftPosition, ftPositionTxt, ftSeparatorAfter, ftSeparatorBefore
  };
  editorGroup = new JComponent[] {
    edContentType, edContentTypeTxt, edPosition, edPositionTxt, edSeparatorAfter, edSeparatorBefore
  };
  readSFS();
}

代码示例来源:origin: stackoverflow.com

add( comboBox );
comboBox.addPopupMenuListener(new PopupMenuListener()

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

protected void initializeCombo(CayenneTableModel model, int row, final JTable table) {
  Object currentNode = getCurrentNodeToInitializeCombo(model, row);
  String dbAttributePath = getPathToInitializeCombo(model, row);
  List<String> nodeChildren = getChildren(currentNode, dbAttributePath);
  this.table = table;
  comboBoxPathChooser = Application.getWidgetFactory().createComboBox(
      nodeChildren,
      false);
  comboBoxPathChooser.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
    @Override
    public void keyReleased(KeyEvent event) {
      if (event.getKeyCode() == KeyEvent.VK_ENTER) {
        enterPressed(table);
        return;
      }
      parsePathString(event.getKeyChar());
    }
  });
  AutoCompletion.enable(comboBoxPathChooser, true, true);
  ((JComponent) comboBoxPathChooser.getEditor().getEditorComponent()).setBorder(null);
  comboBoxPathChooser.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  comboBoxPathChooser.setRenderer(new PathChooserComboBoxCellRenderer());
  comboBoxPathChooser.addActionListener(this);
  comboBoxPathChooser.addPopupMenuListener(this);
}

相关文章

JComboBox类方法