當前位置: 首頁>>代碼示例>>Java>>正文


Java JComboBox.setBounds方法代碼示例

本文整理匯總了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);
}
 
開發者ID:roscisz,項目名稱:KernelHive,代碼行數:26,代碼來源:InputDataPanel.java

示例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());
	}
}
 
開發者ID:roscisz,項目名稱:KernelHive,代碼行數:16,代碼來源:PreferencesDialog.java

示例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);
}
 
開發者ID:QuantumSoundings,項目名稱:BassNES,代碼行數:42,代碼來源:AddBreakPoint.java

示例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);
}
 
開發者ID:Cyphereion,項目名稱:Java-Swing-Helper,代碼行數:56,代碼來源:Panel.java


注:本文中的javax.swing.JComboBox.setBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。