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

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

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

JComboBox.setMaximumRowCount介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

panelSourceLeft.add(labelSource);
comboSource.setMaximumRowCount(15);
comboSource.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
comboSource.setMinimumSize(new java.awt.Dimension(300, 20));
panelSourceRight.add(labelLanguage);
comboLanguage.setMaximumRowCount(15);
comboLanguage.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
comboLanguage.setPreferredSize(new java.awt.Dimension(90, 25));
comboSets.setMaximumRowCount(15);
comboSets.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
comboSets.setPreferredSize(new java.awt.Dimension(373, 25));

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

BorderFactory.createEmptyBorder(10, 10, 10, 10)));
tests = new JComboBox(model.getComboModel());
tests.setMaximumRowCount(30);
tests.setMaximumSize(new Dimension(250, 20));
tests.addActionListener(this);

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

public static void setMaximumRowCount(JComboBox c){
    c.setMaximumRowCount(MAX_MENU_ITEM_COUNT);
  }
}

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

public void setMaximumRowCount(int count) {
  combo.setMaximumRowCount(count);
}

代码示例来源:origin: magefree/mage

cbPreferedImageLanguage.setMaximumRowCount(20);
cbPreferedImageLanguage.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cbNumberOfDownloadThreads.setMaximumRowCount(20);
cbNumberOfDownloadThreads.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

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

@Override
  public void propertyChanged(String propertyName, String newValue, String oldValue) {
    if(PRESENTATION_MAX_DROP_BOX_ROW_COUNT_PROPERTY.equals(propertyName))
      comboBoxCollectionNames.setMaximumRowCount(resourceController.getIntProperty(PRESENTATION_MAX_DROP_BOX_ROW_COUNT_PROPERTY, 9));
  }
});

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

Color[] colors={Color.white,Color.red,Color.blue,Color.green};
JComboBox colorBox = new JComboBox(colors);
colorBox.setMaximumRowCount(5);
colorBox.setPreferredSize(new Dimension(50,20));
colorBox.setRenderer(new MyCellRenderer());

代码示例来源:origin: lbalazscs/Pixelitor

public JComboBox<TwoPointPaintType> createFillPaintCombo() {
  JComboBox cb = new JComboBox<>(fillPaintModel);
  cb.setMaximumRowCount(fillPaintModel.getSize());
  cb.addActionListener(e -> guiChanged());
  return cb;
}

代码示例来源:origin: lbalazscs/Pixelitor

public JComboBox<ShapeType> createShapeTypeCombo() {
  JComboBox<ShapeType> shapeTypeCB = new JComboBox<>(typeModel);
  // make sure all values are visible without a scrollbar
  shapeTypeCB.setMaximumRowCount(typeModel.getSize());
  shapeTypeCB.addActionListener(e -> guiChanged());
  return shapeTypeCB;
}

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

/**
 * Creates undoable JComboBox.
 * 
 */
public <T> JComboBox<T> createUndoableComboBox() {
  JComboBox<T> comboBox = new JComboBox<>();
  comboBox.addItemListener(new JComboBoxUndoListener());
  comboBox.setBackground(Color.WHITE);
  comboBox.setMaximumRowCount(ModelerPreferences.COMBOBOX_MAX_VISIBLE_SIZE);
  return comboBox;
}

代码示例来源:origin: lbalazscs/Pixelitor

public JComboBox<TwoPointPaintType> createStrokePaintCombo() {
  JComboBox cb = new JComboBox<>(strokePaintModel);
  cb.setMaximumRowCount(strokePaintModel.getSize());
  cb.addActionListener(e -> guiChanged());
  return cb;
}

代码示例来源:origin: sarahtattersall/PIPE

/**
 * Creates and adds the token view combo box to the view
 *
 * @param toolBar the JToolBar to add the combo box to
 * @param action  the action that the tokenClassComboBox performs when selected
 * @param view  application view 
 */
private void addTokenClassComboBox(JToolBar toolBar, Action action, PipeApplicationView view) {
  String[] tokenClassChoices = new String[]{"Default"};
  DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>(tokenClassChoices);
  JComboBox<String> tokenClassComboBox = new JComboBox<>(model);
  tokenClassComboBox.setEditable(true);
  tokenClassComboBox.setSelectedItem(tokenClassChoices[0]);
  tokenClassComboBox.setMaximumRowCount(100);
  tokenClassComboBox.setEditable(false);
  tokenClassComboBox.setAction(action);
  view.register(tokenClassComboBox);
  toolBar.add(tokenClassComboBox);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

@Override
  public void processDataBinding() {
    combobox.setMaximumRowCount( getMaximumRowCount() != null ? getMaximumRowCount() : 8 );
  }
});

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

@Override
  public void processDataBinding() {
    combobox.setMaximumRowCount( getMaximumRowCount() != null ? getMaximumRowCount() : 8 );
  }
});

代码示例来源:origin: lbalazscs/Pixelitor

protected void addTypeSelector() {
  BrushType[] brushTypes = BrushType.values();
  typeSelector = new JComboBox<>(brushTypes);
  settingsPanel.addWithLabel("Brush:", typeSelector, "brushTypeSelector");
  typeSelector.addActionListener(e -> brushTypeChanged());
  // make sure all values are visible without a scrollbar
  typeSelector.setMaximumRowCount(brushTypes.length);
}

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

/**
 * Creates a new JComboBox.
 */
public <T> JComboBox<T> createComboBox() {
  JComboBox<T> comboBox = new JComboBox<>();
  comboBox.setFont(UIManager.getFont("Label.font"));
  comboBox.setBackground(Color.WHITE);
  comboBox.setMaximumRowCount(ModelerPreferences.COMBOBOX_MAX_VISIBLE_SIZE);
  return comboBox;
}

代码示例来源:origin: lbalazscs/Pixelitor

private void addGuidesSelector() {
    guidesSelector = new JComboBox<>(RectGuidelineType.values());
    guidesSelector.setToolTipText("<html>Composition guides." +
        "<br><br>Press <b>O</b> to select the next guide." +
        "<br>Press <b>Shift-O</b> to change the orientation.");
    guidesSelector.setMaximumRowCount(guidesSelector.getItemCount());
//        guidesSelector.setSelectedItem(RectGuidelineType.RULE_OF_THIRDS);
    guidesSelector.addActionListener(e -> OpenComps.repaintActive());
    settingsPanel.addWithLabel("Guides:", guidesSelector);
  }

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

public ObjectComboBox(final IObjectListConfiguration<T> configuration, final IComboBoxModel<T> listModel) {
 this.objectModel = listModel;
 final JComboBox<T> list = new JComboBox<>(listModel);
 list.setRenderer(
   new ObjectUiListCellRenderer<>(
     configuration.getObjectUiCellRendererConfiguration(),
     configuration.getObjectUi()));
 list.setPrototypeDisplayValue(configuration.getPrototype());
 list.setMaximumRowCount(configuration.getVisibleRowCount());
 this.component = list;
}

代码示例来源:origin: nroduit/Weasis

private static void initCombo(JComboBox<?> combo) {
  // Set before tooltip, otherwise update UI => remove selection listener
  combo.setFont(FontTools.getFont11());
  combo.setMaximumRowCount(15);
  JMVUtils.setPreferredWidth(combo, 80);
  // Update UI before adding the Tooltip feature in the combobox list
  combo.updateUI();
  JMVUtils.addTooltipToComboList(combo);
}

代码示例来源:origin: org.biojava.thirdparty/forester

public JComboBox<String> getSequenceRelationBox() {
  if ( _show_sequence_relations == null ) {
    _show_sequence_relations = new JComboBox<String>();
    _show_sequence_relations.setFocusable( false );
    _show_sequence_relations.setMaximumRowCount( 20 );
    _show_sequence_relations.setFont( ControlPanel.js_font );
    if ( !_configuration.isUseNativeUI() ) {
      _show_sequence_relations.setBackground( getConfiguration().getGuiButtonBackgroundColor() );
      _show_sequence_relations.setForeground( getConfiguration().getGuiButtonTextColor() );
    }
    _show_sequence_relations.addItem( "-----" );
    _show_sequence_relations.setToolTipText( "To display orthology information for selected query" );
  }
  return _show_sequence_relations;
}

相关文章

JComboBox类方法