本文整理了Java中javax.swing.JComboBox.setPreferredSize()
方法的一些代码示例,展示了JComboBox.setPreferredSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.setPreferredSize()
方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:setPreferredSize
暂无
代码示例来源:origin: redwarp/9-Patch-Resizer
inputDensityChoice.setAlignmentX(Component.LEFT_ALIGNMENT);
inputDensityChoice.setAlignmentY(Component.BOTTOM_ALIGNMENT);
inputDensityChoice.setPreferredSize(new Dimension(1, 10));
代码示例来源:origin: marytts/marytts
comboMaxAmplitude.setSelectedIndex(4);
comboMaxAmplitude.setMinimumSize(new java.awt.Dimension(70, 28));
comboMaxAmplitude.setPreferredSize(new java.awt.Dimension(70, 28));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
代码示例来源:origin: marytts/marytts
comboMaxAmplitude.setSelectedIndex(4);
comboMaxAmplitude.setMinimumSize(new java.awt.Dimension(70, 28));
comboMaxAmplitude.setPreferredSize(new java.awt.Dimension(70, 28));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
代码示例来源:origin: runelite/runelite
box.setPreferredSize(new Dimension(box.getPreferredSize().width, 25));
box.setRenderer(new ComboBoxListRenderer());
box.setForeground(Color.WHITE);
代码示例来源:origin: marytts/marytts
cbAudioSource.setPreferredSize(new java.awt.Dimension(250, 27));
cbAudioSource.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbExpertOutput.setPreferredSize(new java.awt.Dimension(250, 27));
cbExpertOutput.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbSpeakerOutput.setPreferredSize(new java.awt.Dimension(250, 27));
cbSpeakerOutput.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: magefree/mage
pack.setAlignmentX(0.0F);
pack.setMinimumSize(new Dimension(50, 25));
pack.setPreferredSize(new Dimension(50, 25));
pack.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));
setPanel.add(pack);
代码示例来源:origin: nodebox/nodebox
public FontControl(String nodePath, Port port) {
super(nodePath, port);
setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
fontChooser = new JComboBox<>();
fontModel = new FontDataModel();
FontCellRenderer fontCellRenderer = new FontCellRenderer();
fontChooser.setModel(fontModel);
fontChooser.setRenderer(fontCellRenderer);
fontChooser.putClientProperty("JComponent.sizeVariant", "small");
fontChooser.setPreferredSize(new Dimension(150, 22));
fontChooser.putClientProperty("JComboBox.isPopDown", Boolean.TRUE);
fontChooser.addActionListener(this);
fontChooser.setFont(Theme.SMALL_BOLD_FONT);
add(fontChooser);
setValueForControl(port.getValue());
}
代码示例来源:origin: magefree/mage
comboSource.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
comboSource.setMinimumSize(new java.awt.Dimension(300, 20));
comboSource.setPreferredSize(new java.awt.Dimension(400, 25));
panelSourceLeft.add(comboSource);
comboLanguage.setPreferredSize(new java.awt.Dimension(90, 25));
panelSourceRight.add(comboLanguage);
comboSets.setPreferredSize(new java.awt.Dimension(373, 25));
panelModeSelect.add(comboSets);
panelModeSelect.add(fillerMode1);
代码示例来源:origin: magefree/mage
formats.setAlignmentX(0.0F);
formats.setMinimumSize(new Dimension(50, 25));
formats.setPreferredSize(new Dimension(50, 25));
formats.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));
setPanel.add(formats);
代码示例来源:origin: magefree/mage
cbSortBy.setName("SortBy"); // NOI18N
cbSortBy.setOpaque(false);
cbSortBy.setPreferredSize(new java.awt.Dimension(120, 20));
cbSortBy.addActionListener(evt -> cbSortByActionPerformed(evt));
代码示例来源: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"));
代码示例来源:origin: magefree/mage
cbExpansionSet.setMinimumSize(new java.awt.Dimension(250, 25));
cbExpansionSet.setName("cbExpansionSet"); // NOI18N
cbExpansionSet.setPreferredSize(new java.awt.Dimension(250, 25));
cbExpansionSet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbSortBy.setPreferredSize(new java.awt.Dimension(120, 20));
cbSortBy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: pentaho/mondrian
"schemaExplorer.hierarchy.select.title",
"Select Join or Table Hierarchy"));
listEditor.setPreferredSize(
new java.awt.Dimension(
listEditor.getPreferredSize().width,
代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik
/**
* Adds the given text to the history.
*/
public void addToHistory(String text) {
comboBox.addItem(text);
comboBox.setPreferredSize
(new Dimension(0, comboBox.getPreferredSize().height));
}
}
代码示例来源:origin: cytoscape.coreplugins/attribute-browser
private JComboBox createAttributeBox() {
JComboBox box = new JComboBox(defaultAttrModel);
Dimension newSize = new Dimension(100, (int) box.getPreferredSize().getHeight());
box.setMaximumSize(newSize);
box.setPreferredSize(newSize);
return box;
}
代码示例来源: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: protegeproject/protege
public JComboBox<OWLDatatype> getDatatypeSelector() {
final OWLModelManager mngr = getOWLModelManager();
List<OWLDatatype> datatypeList = new ArrayList<>(new OWLDataTypeUtils(mngr.getOWLOntologyManager()).getKnownDatatypes(mngr.getActiveOntologies()));
Collections.sort(datatypeList, mngr.getOWLObjectComparator());
datatypeList.add(0, null);
JComboBox<OWLDatatype> c = new JComboBox<>(new DefaultComboBoxModel<>(datatypeList.toArray(new OWLDatatype [datatypeList.size()])));
c.setPreferredSize(new Dimension(120, c.getPreferredSize().height));
c.setRenderer(new OWLCellRendererSimple(owlEditorKit));
return c;
}
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
public JComboBox<OWLDatatype> getDatatypeSelector() {
final OWLModelManager mngr = getOWLModelManager();
List<OWLDatatype> datatypeList = new ArrayList<>(new OWLDataTypeUtils(mngr.getOWLOntologyManager()).getKnownDatatypes(mngr.getActiveOntologies()));
Collections.sort(datatypeList, mngr.getOWLObjectComparator());
datatypeList.add(0, null);
JComboBox<OWLDatatype> c = new JComboBox<>(new DefaultComboBoxModel<>(datatypeList.toArray(new OWLDatatype [datatypeList.size()])));
c.setPreferredSize(new Dimension(120, c.getPreferredSize().height));
c.setRenderer(new OWLCellRendererSimple(owlEditorKit));
return c;
}
}
代码示例来源:origin: cytoscape/application
public NetworkSelectorPanel() {
super();
this.setLayout(new BorderLayout());
networkComboBox = new JComboBox();
//This should help to limit the length of combobox if the network name is too long
networkComboBox.setPreferredSize(new java.awt.Dimension(networkComboBox.getPreferredSize().width,
networkComboBox.getPreferredSize().height));
add(networkComboBox, BorderLayout.CENTER);
updateNetworkList();
Cytoscape.getPropertyChangeSupport().addPropertyChangeListener(this);
}
代码示例来源:origin: freeplane/freeplane
public Container createSizeBox() {
final JComboBox sizeBox = new JComboBoxWithBorder(size);
sizeBox.setPrototypeDisplayValue("88888");
sizeBox.setPreferredSize(sizeBox.getPreferredSize());
sizeBox.setEditor(new FixedBasicComboBoxEditor());
sizeBox.setEditable(true);
return sizeBox;
}
内容来源于网络,如有侵权,请联系作者删除!