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

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

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

JComboBox.setLightWeightPopupEnabled介绍

暂无

代码示例

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

public void setLightWeightPopupEnabled(boolean aFlag) {
  combo.setLightWeightPopupEnabled(aFlag);
}

代码示例来源:origin: jsettlers/settlers-remake

/**
 * Constructor
 */
public EditorControl() {
  // use heavyweight component
  playerCombobox.setLightWeightPopupEnabled(false);
  playerCombobox.addActionListener(e -> currentPlayer = (Integer) playerCombobox.getSelectedItem());
  playerCombobox.setRenderer(new DefaultListCellRenderer() {
    private static final long serialVersionUID = 1L;
    @Override
    public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
      Integer player = (Integer) value;
      setIcon(new RectIcon(22, new Color(mapContent.getPlayerColor(player.byteValue()).getARGB()), Color.GRAY));
      setText(String.format(Locale.ENGLISH, EditorLabels.getLabel("general.player_x"), player));
      return this;
    }
  });
}

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

JComboBox listBox = new JComboBox(listNames.toArray());
listBox.setVisible(true);

// additional line below    
listBox.setLightWeightPopupEnabled(false); // use heavyweight component

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf

@Override
public void uninstallUI(JComponent c) {
  comboBox.setLightWeightPopupEnabled(wasLightWeightPopupEnabled);
  NapkinUtil.uninstallUI(c);
  c.setBorder(oldBorder);
  super.uninstallUI(c);
}

代码示例来源: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: atarw/material-ui-swing

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JComboBox<?> comboBox = (JComboBox<?>) c;
  comboBox.setFont (UIManager.getFont ("ComboBox.font"));
  comboBox.setBackground (UIManager.getColor ("ComboBox.background"));
  comboBox.setForeground (UIManager.getColor ("ComboBox.foreground"));
  comboBox.setBorder (UIManager.getBorder ("ComboBox.border"));
  comboBox.setLightWeightPopupEnabled (true);
  comboBox.setRenderer (new MaterialComboBoxRenderer ());
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf

@Override
public void installUI(JComponent c) {
  super.installUI(c);
  oldBorder = c.getBorder();
  c.setBorder(new NapkinCompoundBorder(new NapkinLineBorder(false),
      new EmptyBorder(0, 0, 3, 0)));
  NapkinUtil.installUI(c);
  wasLightWeightPopupEnabled = comboBox.isLightWeightPopupEnabled();
  comboBox.setLightWeightPopupEnabled(false);
}

代码示例来源:origin: org.junit/com.springsource.junit

protected JComboBox createSuiteCombo() {
  JComboBox combo= new JComboBox();
  combo.setEditable(true);
  combo.setLightWeightPopupEnabled(false);
  combo.getEditor().getEditorComponent().addKeyListener(
    new KeyAdapter() {
      public void keyTyped(KeyEvent e) {
        textChanged();
        if (e.getKeyChar() == KeyEvent.VK_ENTER)
          runSuite();
      }
    }
  );
  try {
    loadHistory(combo);
  } catch (IOException e) {
    // fails the first time
  }
  combo.addItemListener(
    new ItemListener() {
      public void itemStateChanged(ItemEvent event) {
        if (event.getStateChange() == ItemEvent.SELECTED) {
          textChanged();
        }
      }
    }
  );
  return combo;
}

代码示例来源:origin: org.cytoscape/network-analyzer-impl

cbxNodeSize.setLightWeightPopupEnabled(false);
cbxNodeSize.addActionListener(this);
cbxNodeSize.setRenderer(new ComboBoxRenderer());
cbxNodeColor.setLightWeightPopupEnabled(false);
cbxNodeColor.addActionListener(this);
cbxNodeColor.setRenderer(new ComboBoxRenderer());
cbxEdgeSize.setLightWeightPopupEnabled(false);
cbxEdgeSize.addActionListener(this);
cbxEdgeSize.setRenderer(new ComboBoxRenderer());
cbxEdgeColor.setLightWeightPopupEnabled(false);
cbxEdgeColor.addActionListener(this);
cbxEdgeColor.setRenderer(new ComboBoxRenderer());

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

comb.setLightWeightPopupEnabled(true);
panel.add(label);
panel.add(button);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

GridBagConstraints constraints = new GridBagConstraints();
m_XCombo.setLightWeightPopupEnabled(false);
m_YCombo.setLightWeightPopupEnabled(false);
m_ColourCombo.setLightWeightPopupEnabled(false);
m_ShapeCombo.setLightWeightPopupEnabled(false);
combos.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));

代码示例来源:origin: com.github.tntim96/rhino

JLabel label = new JLabel("Context:");
context = new JComboBox();
context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());

代码示例来源:origin: Waikato/weka-trunk

GridBagConstraints constraints = new GridBagConstraints();
m_XCombo.setLightWeightPopupEnabled(false);
m_YCombo.setLightWeightPopupEnabled(false);
m_ColourCombo.setLightWeightPopupEnabled(false);
m_ShapeCombo.setLightWeightPopupEnabled(false);
combos.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));

代码示例来源:origin: com.github.houbie/rhino-mod

JLabel label = new JLabel("Context:");
context = new JComboBox();
context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());

代码示例来源:origin: openpnp/openpnp

partsComboBox.setRenderer(new IdentifiableListCellRenderer<Part>());
partsComboBox.setEditable(false);
partsComboBox.setLightWeightPopupEnabled(false);
partsComboBox.setMaximumRowCount(7);

代码示例来源:origin: ro.isdc.wro4j/rhino

JLabel label = new JLabel("Context:");
context = new JComboBox();
context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

JLabel label = new JLabel("Context:");
context = new JComboBox();
context.setLightWeightPopupEnabled(false);
toolTips = Collections.synchronizedList(new java.util.ArrayList<String>());
label.setBorder(context.getBorder());

代码示例来源:origin: org.xworker/xworker_core

comp.setLightWeightPopupEnabled(lightWeightPopupEnabled);

相关文章

JComboBox类方法