Java Code Examples for javax.swing.JComboBox.setBounds()

The following are Jave code examples for showing how to use setBounds() of the javax.swing.JComboBox class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: KernelHive   File: InputDataPanel.java   Source Code and License Vote up 6 votes
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);
}
 
Example 2
Project: KernelHive   File: PreferencesDialog.java   Source Code and License Vote up 5 votes
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());
	}
}
 
Example 3
Project: BassNES   File: AddBreakPoint.java   Source Code and License Vote up 5 votes
/**
 * 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);
}
 
Example 4
Project: Java-Swing-Helper   File: Panel.java   Source Code and License Vote up 4 votes
@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);
}