本文整理汇总了Java中javax.swing.JComboBox.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java JComboBox.setBounds方法的具体用法?Java JComboBox.setBounds怎么用?Java JComboBox.setBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComboBox
的用法示例。
在下文中一共展示了JComboBox.setBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InputDataPanel
import javax.swing.JComboBox; //导入方法依赖的package包/类
public InputDataPanel(List<String> previouslyUsedURLs) {
setSize(new Dimension(900, 300));
setPreferredSize(new Dimension(900, 300));
setMinimumSize(new Dimension(450, 300));
setLayout(null);
JLabel lblInputDataUrl = new JLabel("Input data URL");
lblInputDataUrl.setBounds(12, 12, 105, 15);
add(lblInputDataUrl);
lblUrlIsInvalid = new JLabel("URL is invalid!");
lblUrlIsInvalid.setVisible(false);
lblUrlIsInvalid.setBounds(12, 70, 105, 15);
add(lblUrlIsInvalid);
btnValidate = new JButton("Validate");
btnValidate.setBounds(335, 34, 93, 25);
//add(btnValidate);
comboBox = new JComboBox();
comboBox.setEditable(true);
comboBox.setBounds(12, 34, 311, 24);
comboBox.setModel(new URLComboBoxModel(previouslyUsedURLs));
add(comboBox);
}
示例2: initUI
import javax.swing.JComboBox; //导入方法依赖的package包/类
private void initUI() {
List<String> languages = AppConfiguration.getInstance()
.getAvailableLanguageResourceBundles();
comboBox = new JComboBox(languages.toArray());
comboBox.setSelectedItem(AppConfiguration.getInstance()
.getSelectedLanguage());
comboBox.setBounds(110, 7, 102, 24);
getContentPane().add(comboBox);
URL engineAddress = AppConfiguration.getInstance().getEngineAddress();
if (engineAddress != null) {
textEngineAddress.setText(engineAddress.toString());
}
}
示例3: AddBreakPoint
import javax.swing.JComboBox; //导入方法依赖的package包/类
/**
* Create the frame.
*/
public AddBreakPoint(DefaultListModel<BreakPoint> breakpoint) {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JComboBox<Object> comboBox = new JComboBox<Object>();
comboBox.setModel(new DefaultComboBoxModel<Object>(Variable.values()));
comboBox.setBounds(10, 115, 141, 20);
contentPane.add(comboBox);
textField = new JTextField();
textField.setBounds(226, 115, 141, 20);
contentPane.add(textField);
textField.setColumns(10);
JButton btnAddBreakpoint = new JButton("Add BreakPoint");
btnAddBreakpoint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Object val = null;
String text = textField.getText().toLowerCase();
if(text.equals("true"))
val = true;
else if(text.equals("false"))
val = false;
else{
val = Integer.parseInt(text, 16);
}
breakpoint.addElement(new BreakPoint((Variable) comboBox.getSelectedItem(),val));
setVisible(false);
dispose();
}
});
btnAddBreakpoint.setBounds(138, 191, 141, 23);
contentPane.add(btnAddBreakpoint);
}
示例4: loadScene
import javax.swing.JComboBox; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void loadScene(Container container) {
JButton btnNextScene = new JButton("NEXT SCENE");
btnNextScene.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
SimpleTest.window.loadScene(new SceneText());
}
});
btnNextScene.setBounds(21, 409, 128, 41);
container.add(btnNextScene);
JLabel lblImAJlabel = new JLabel("I'm a JLabel!");
lblImAJlabel.setFont(new Font("Tahoma", Font.PLAIN, 17));
lblImAJlabel.setHorizontalAlignment(SwingConstants.CENTER);
lblImAJlabel.setBounds(30, 59, 208, 49);
container.add(lblImAJlabel);
JComboBox comboBox = new JComboBox();
String[] arr = new String[150];
for (int i = 0; i < arr.length; i++) {
arr[i] = i + "";
}
comboBox.setModel(new DefaultComboBoxModel(arr));
comboBox.setBounds(48, 184, 190, 113);
container.add(comboBox);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(384, 59, 251, 197);
container.add(scrollPane);
JTextPane txtpnTextpane = new JTextPane();
txtpnTextpane.setText("TextPane!");
scrollPane.setViewportView(txtpnTextpane);
JScrollBar scrollBar = new JScrollBar();
scrollBar.setOrientation(JScrollBar.HORIZONTAL);
scrollBar.setBounds(131, 361, 365, 40);
container.add(scrollBar);
table = new JTable();
table.setModel(new DefaultTableModel(new Object[][] { { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, },
new String[] { "New column", "New column", "New column", "New column", "New column", "New column",
"New column", "New column" }));
table.setBounds(506, 287, 252, 128);
container.add(table);
JTree tree = new JTree();
tree.setBounds(248, 11, 107, 139);
container.add(tree);
}