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

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

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

JComboBox.setMinimumSize介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

recentTregexPatterns.setMinimumSize(new Dimension(120, 24));
recentTregexPatterns.addActionListener(this);

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

"1.4 (causes clipping)", "1.5 (causes clipping)" }));
comboMaxAmplitude.setSelectedIndex(4);
comboMaxAmplitude.setMinimumSize(new java.awt.Dimension(70, 28));
comboMaxAmplitude.setPreferredSize(new java.awt.Dimension(70, 28));
gridBagConstraints = new java.awt.GridBagConstraints();

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

"1.4 (causes clipping)", "1.5 (causes clipping)" }));
comboMaxAmplitude.setSelectedIndex(4);
comboMaxAmplitude.setMinimumSize(new java.awt.Dimension(70, 28));
comboMaxAmplitude.setPreferredSize(new java.awt.Dimension(70, 28));
gridBagConstraints = new java.awt.GridBagConstraints();

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

pack.addActionListener(evt -> packActionPerformed(evt));
pack.setAlignmentX(0.0F);
pack.setMinimumSize(new Dimension(50, 25));
pack.setPreferredSize(new Dimension(50, 25));
pack.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));

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

comboSource.setMinimumSize(new java.awt.Dimension(300, 20));
comboSource.setPreferredSize(new java.awt.Dimension(400, 25));
panelSourceLeft.add(comboSource);

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

cbLandSet.setMinimumSize(new java.awt.Dimension(20, 20));
panelSet.add(cbLandSet);

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

formats.setSelectedItem(ConstructedFormats.getDefault());
formats.setAlignmentX(0.0F);
formats.setMinimumSize(new Dimension(50, 25));
formats.setPreferredSize(new Dimension(50, 25));
formats.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));

代码示例来源:origin: pentaho/mondrian

relationList.setMaximumSize(new Dimension(55, 22));
relationList.setPreferredSize(new Dimension(55, 22));
relationList.setMinimumSize(new Dimension(55, 22));
relationList.setFont(Font.decode("Dialog"));
relationList.setBackground(Color.white);

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

cbSortBy.setToolTipText("Sort the cards if card view is active.");
cbSortBy.setMaximumSize(new java.awt.Dimension(120, 20));
cbSortBy.setMinimumSize(new java.awt.Dimension(120, 20));
cbSortBy.setName("SortBy"); // NOI18N
cbSortBy.setOpaque(false);

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

cbExpansionSet.setMinimumSize(new java.awt.Dimension(250, 25));
cbExpansionSet.setName("cbExpansionSet"); // NOI18N
cbExpansionSet.setPreferredSize(new java.awt.Dimension(250, 25));
cbSortBy.setMinimumSize(new java.awt.Dimension(120, 20));
cbSortBy.setPreferredSize(new java.awt.Dimension(120, 20));
cbSortBy.addActionListener(new java.awt.event.ActionListener() {

代码示例来源:origin: cpesch/RouteConverter

private void createUIComponents() {
  comboBoxChoosePositionList = new JComboBox<FormatAndRoutesModel>() {
    public Dimension getPreferredSize() {
      Dimension preferredSize = super.getPreferredSize();
      preferredSize.width = convertPanel.getPreferredSize().width - 300;
      return preferredSize;
    }
  };
  comboBoxChoosePositionList.setMinimumSize(new Dimension(-1, comboBoxChoosePositionList.getMinimumSize().height));
}

代码示例来源:origin: bcdev/beam

private void setComboBoxSize(Dimension comboBoxDimension, JComboBox comboBox) {
  comboBox.setPreferredSize(comboBoxDimension);
  comboBox.setMinimumSize(comboBoxDimension);
}

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

private void initSelectionCombos () {
  if (fixedRevisions) {
    treeSelectionPanel.setVisible(false);
  } else {
    cmbDiffTreeFirst.setMinimumSize(cmbDiffTreeFirst.getMinimumSize());
    cmbDiffTreeSecond.setMinimumSize(cmbDiffTreeSecond.getMinimumSize());
    treeSelectionPanel.setMinimumSize(treeSelectionPanel.getMinimumSize());
    cmbDiffTreeFirst.setRenderer(new HgRevisionCellRenderer());
    cmbDiffTreeFirst.setModel(new DefaultComboBoxModel(new HgRevision[] { revisionRight }));
    cmbDiffTreeFirst.addActionListener(this);
    cmbDiffTreeSecond.setRenderer(new HgRevisionCellRenderer());
    cmbDiffTreeSecond.setModel(new DefaultComboBoxModel(new HgRevision[] { revisionLeft }));
    cmbDiffTreeSecond.addActionListener(this);
  }
}

代码示例来源:origin: senbox-org/snap-desktop

public StringSelectorDialog(final String title, final String[] itemNames) {
  super(SnapApp.getDefault().getMainFrame(), title, ModalDialog.ID_OK_CANCEL, null);
  final JPanel content = new JPanel(new GridBagLayout());
  final GridBagConstraints gbc = DialogUtils.createGridBagConstraints();
  list = new JComboBox(itemNames);
  list.setMinimumSize(new Dimension(50, 4));
  content.add(list, gbc);
  getJDialog().setMinimumSize(new Dimension(200, 100));
  setContent(content);
}

代码示例来源:origin: org.activecomponents.jadex/jadex-editor-bpmn

public ConfigComboBox(ConfigurationModel model, final AbstractTableModel tmodel)
{
  setLayout(new GridBagLayout());
  JLabel label = new JLabel("Configuration");
  GridBagConstraints gc = new GridBagConstraints();
  add(label, gc);
  combobox = new JComboBox(model);
  combobox.setMinimumSize(new Dimension(200, (int) combobox.getMinimumSize().getHeight()));
  gc = new GridBagConstraints();
  gc.gridx = 1;
  gc.weightx = 1.0;
  gc.weighty = 1.0;
  gc.fill = GridBagConstraints.BOTH;
  gc.insets = new Insets(5, 5, 0, 0);
  add(combobox, gc);
  
  if (tmodel != null)
  {
    combobox.addItemListener(new ItemListener()
    {
      public void itemStateChanged(ItemEvent e)
      {
        tmodel.fireTableStructureChanged();
      }
    });
  }
}

代码示例来源:origin: cytoscape.coreplugins/attribute-browser

private void initApplyToComboBox(final Container contentPane) {
  applyToComboBox = new JComboBox();
  final int selectedCellRow = table.getSelectedRow();
  if (selectedCellRow >= 0)
    applyToComboBox.addItem(ApplicationDomain.CURRENT_CELL);
  final List<GraphObject> selectedGraphObjects = tableModel.getObjects();
  if (selectedGraphObjects != null && !selectedGraphObjects.isEmpty())
    applyToComboBox.addItem(ApplicationDomain.CURRENT_SELECTION);
  applyToComboBox.addItem(ApplicationDomain.ENTIRE_ATTRIBUTE);
  final Dimension widthAndHeight = applyToComboBox.getPreferredSize();
  final Dimension desiredWidthAndHeight = new Dimension(180, 30);
  applyToComboBox.setPreferredSize(desiredWidthAndHeight);
  applyToComboBox.setMinimumSize(desiredWidthAndHeight);
  applyToComboBox.setSize(desiredWidthAndHeight);
  applyToComboBox.setMaximumSize(desiredWidthAndHeight);
  contentPane.add(applyToComboBox);
  applyToComboBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        applicationDomain = (ApplicationDomain)applyToComboBox.getSelectedItem();
      }
    });
  applyToComboBox.setEditable(false);
  applyToComboBox.setEnabled(false);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore

private void initCombo(JComponent bar, JComboBox comboBox) {
  GridBagConstraints constrains = new GridBagConstraints();
  constrains.anchor = GridBagConstraints.WEST;
  //@inherited fix of issue #69642. Focus shouldn't stay in toolbar
  comboBox.setFocusable(false);
  Dimension size = comboBox.getPreferredSize();
  comboBox.setPreferredSize(size);
  comboBox.setSize(size);
  comboBox.setMinimumSize(size);
  comboBox.setMaximumSize(size);
  comboBox.setEditable(true);
  bar.add(comboBox, constrains);
}

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

/**
 * Adds a zoom combo box to the toolbar
 *
 * @param toolBar the JToolBar to add the button to
 * @param action  the action that the ZoomComboBox performs
 * @param view application view 
 */
private void addZoomComboBox(JToolBar toolBar, Action action, String[] zoomExamples, PipeApplicationView view) {
  Dimension zoomComboBoxDimension = new Dimension(65, 28);
  JComboBox<String> zoomComboBox = new JComboBox<>(zoomExamples);
  zoomComboBox.setEditable(true);
  zoomComboBox.setSelectedItem("100%");
  zoomComboBox.setMaximumRowCount(zoomExamples.length);
  zoomComboBox.setMaximumSize(zoomComboBoxDimension);
  zoomComboBox.setMinimumSize(zoomComboBoxDimension);
  zoomComboBox.setPreferredSize(zoomComboBoxDimension);
  zoomComboBox.setAction(action);
  view.registerZoom(zoomComboBox);
  toolBar.add(zoomComboBox);
}

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

/**
 * Sets the combo-boxes to a fixed size so they don't take up too much room
 * that would be better devoted to the test output box.
 */
protected void setComboSizes() {
 m_TesterClasses.setPreferredSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setPreferredSize(COMBO_SIZE);
 m_CompareCombo.setPreferredSize(COMBO_SIZE);
 m_SigTex.setPreferredSize(COMBO_SIZE);
 m_SortCombo.setPreferredSize(COMBO_SIZE);
 m_TesterClasses.setMaximumSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setMaximumSize(COMBO_SIZE);
 m_CompareCombo.setMaximumSize(COMBO_SIZE);
 m_SigTex.setMaximumSize(COMBO_SIZE);
 m_SortCombo.setMaximumSize(COMBO_SIZE);
 m_TesterClasses.setMinimumSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setMinimumSize(COMBO_SIZE);
 m_CompareCombo.setMinimumSize(COMBO_SIZE);
 m_SigTex.setMinimumSize(COMBO_SIZE);
 m_SortCombo.setMinimumSize(COMBO_SIZE);
}

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

/**
 * Sets the combo-boxes to a fixed size so they don't take up too much room
 * that would be better devoted to the test output box.
 */
protected void setComboSizes() {
 m_TesterClasses.setPreferredSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setPreferredSize(COMBO_SIZE);
 m_CompareCombo.setPreferredSize(COMBO_SIZE);
 m_SigTex.setPreferredSize(COMBO_SIZE);
 m_SortCombo.setPreferredSize(COMBO_SIZE);
 m_TesterClasses.setMaximumSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setMaximumSize(COMBO_SIZE);
 m_CompareCombo.setMaximumSize(COMBO_SIZE);
 m_SigTex.setMaximumSize(COMBO_SIZE);
 m_SortCombo.setMaximumSize(COMBO_SIZE);
 m_TesterClasses.setMinimumSize(COMBO_SIZE);
 m_PanelDatasetResultKeys.setMinimumSize(COMBO_SIZE);
 m_CompareCombo.setMinimumSize(COMBO_SIZE);
 m_SigTex.setMinimumSize(COMBO_SIZE);
 m_SortCombo.setMinimumSize(COMBO_SIZE);
}

相关文章

JComboBox类方法