本文整理了Java中javax.swing.JComboBox.setBounds()
方法的一些代码示例,展示了JComboBox.setBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.setBounds()
方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:setBounds
暂无
代码示例来源:origin: stackoverflow.com
public class Execute extends JFrame {
private JComboBox comboAccountName = new JComboBox();
public Execute()
{
comboAccountName.setBounds(313, 31, 302, 20);
getContentPane().add(comboAccountName);
}
代码示例来源:origin: stackoverflow.com
public class Execute extends JFrame {
public Execute()
{
JComboBox comboAccountName = new JComboBox(); // this guy is visible only in here
comboAccountName.setBounds(313, 31, 302, 20); // don't do this!
getContentPane().add(comboAccountName);
}
代码示例来源:origin: stackoverflow.com
JComboBox comboBox = new JComboBox();
comboBox.setBounds(84, 45, 150, 20);
contentPane.add(comboBox);
JComboBox comboBox_1 = new JComboBox();
comboBox_1.setBounds(84, 97, 150, 20);
contentPane.add(comboBox_1);
comboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent arg0) {
//Do Something
}
});
}
代码示例来源:origin: stackoverflow.com
JComboBox comboBox = new JComboBox();
comboBox.setBounds(112, 115, 145, 20);
contentPane.add(comboBox);
comboBox.addItem(al);
代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section, String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section,String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section,String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section,String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: stackoverflow.com
JComboBox category = new JComboBox();
category.addActionListener(this);
category.setActionCommand("combo");
category.setBounds(125,200,400,50);
add(category);
category.setModel(new DefaultComboBoxModel<>(cats));
代码示例来源:origin: stackoverflow.com
JPanel panel = new JPanel();
panel.setLayout(null);
String[] items = {"hello","goodbye","etc"};
JComboBox cbox = new JComboBox(items);
panel.add(cbox);
cbox.setBounds(0, 0, 100, 20);
cbox.doLayout(); // force the JComboBox internals to use your bounds
代码示例来源:origin: org.restcomm.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section,String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-gui
private JComboBox createCombo(JPanel section,String name, int y_pos) {
JLabel label = new JLabel(name);
label.setBounds(10, y_pos, 174, 14);
section.add(label);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(194, y_pos, 307, 20);
section.add(comboBox);
return comboBox;
}
代码示例来源:origin: sc.fiji/Image_Expression_Parser
/**
* Redisplay the image boxes
*/
private void refreshImageBoxes()
{
final int width = jPanelImages.getWidth();
for ( int i = 0; i < n_image_box; i++ )
{
image_boxes.get( i ).setBounds( 30, 10 + BOX_SPACE * i, width - 50, 30 );
}
}
代码示例来源:origin: stackoverflow.com
JComboBox comboBox = new JComboBox(new String[]{"Flute", "Piano", "Cello"});
comboBox.setBounds(0, 0, comboBox.getPreferredSize().width, comboBox.getPreferredSize().height);
_comboBoxes.add(comboBox);
JPanel comboBoxPanel = new JPanel();
comboBoxPanel.setLayout(null);
comboBoxPanel.add(comboBox);
代码示例来源:origin: stackoverflow.com
String[] KundLista = { "Normal", "Företag", "Student"};
JComboBox comboBox = new JComboBox(KundLista);
comboBox.setToolTipText("Välj vilken typ av Kund du är");
combobox.setRenderer(new MyComboBoxRenderer("Choose"));
comboBox.setSelectedIndex(-1); // By default it selects first item, we don't want any selection
comboBox.setBounds(171, 46, 97, 22);
frame.getContentPane().add(comboBox);
代码示例来源:origin: org.apache.geronimo.daytrader.modules/wsappclient
/**
* This method initializes jComboBox
*
* @return JComboBox
*/
private JComboBox getJComboBox() {
if (jComboBox == null) {
jComboBox = new JComboBox();
jComboBox.setBounds(166, 41, 161, 16);
jComboBox.setBackground(new java.awt.Color(220, 220, 220));
jComboBox.setFont(new java.awt.Font("Arial", 1, 10));
jComboBox.addItem("Get Quote");
jComboBox.addItem("Get Quote - NULL");
// TODO more scenarios here
// jComboBox.addItem("Holdings Only");
}
return jComboBox;
}
/**
代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine
/**
* Creates the input type chooser.
*/
private void createTypeChooser()
{
typeLabel = new JLabel("Input type: ");
typeLabel.setBounds(10, 80, 130, 25);
this.add(typeLabel);
typeChooser = new JComboBox();
typeChooser.setBounds(150, 80, 110, 25);
typeChooser.addItem(InputType.XML);
if (this.controller.is7ZipEnabled()) {
typeChooser.addItem(InputType.SEVENZIP);
}
typeChooser.addItem(InputType.BZIP2);
this.add(typeChooser);
}
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Creates the input type chooser.
*/
private void createTypeChooser()
{
typeLabel = new JLabel("Input type: ");
typeLabel.setBounds(10, 80, 130, 25);
this.add(typeLabel);
typeChooser = new JComboBox();
typeChooser.setBounds(150, 80, 110, 25);
typeChooser.addItem(InputType.XML);
if (this.controller.is7ZipEnabled()) {
typeChooser.addItem(InputType.SEVENZIP);
}
typeChooser.addItem(InputType.BZIP2);
this.add(typeChooser);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-core-ui
public void layoutContainer(Container parent) {
Rectangle b = parent.getBounds();
int inset = 8;
int vOffset = 20;
int hOffset = 0;
int btnWSize = 80;
if (parent.getComponentCount() > 1) {
JButton btn = (JButton) parent.getComponent(BTN_IDX);
int btnHSize = (int) btn.getPreferredSize().getHeight();
btn.setBounds(b.width - inset - btnWSize, vOffset, btnWSize, btnHSize);
hOffset = inset + btnWSize;
}
JComboBox combo = (JComboBox) parent.getComponent(COMBO_IDX);
int comboHSize = (int) combo.getPreferredSize().getHeight() + 1;
combo.setBounds(inset, vOffset, b.width - 2 * inset - hOffset, comboHSize);
}
}
代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine
private void createDiffToolLoggingSettings()
{
diffToolLabel = new JLabel("Logging Root Folder: ");
diffToolLabel.setBorder(BorderFactory.createRaisedBevelBorder());
diffToolLabel.setBounds(10, 10, 150, 25);
this.add(diffToolLabel);
diffToolField = new JTextField();
diffToolField.setBounds(170, 10, 200, 25);
this.add(diffToolField);
diffToolLogLevelComboBox = new JComboBox();
diffToolLogLevelComboBox.setBounds(390, 10, 100, 25);
diffToolLogLevelComboBox.addItem(Level.ALL);
diffToolLogLevelComboBox.addItem(Level.SEVERE);
diffToolLogLevelComboBox.addItem(Level.WARNING);
diffToolLogLevelComboBox.addItem(Level.INFO);
diffToolLogLevelComboBox.addItem(Level.OFF);
this.add(diffToolLogLevelComboBox);
}
内容来源于网络,如有侵权,请联系作者删除!