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


Java JTable.setBounds方法代碼示例

本文整理匯總了Java中javax.swing.JTable.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java JTable.setBounds方法的具體用法?Java JTable.setBounds怎麽用?Java JTable.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JTable的用法示例。


在下文中一共展示了JTable.setBounds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: iniciaJTable

import javax.swing.JTable; //導入方法依賴的package包/類
/**
* Método responsável por inicializar JTable
*
*/
private void iniciaJTable() {
	tableTransacoes = new JTable();
	tableTransacoes.setModel(new DefaultTableModel(new Object[][] {},
	retornaNomeColunas()));
	tableTransacoes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	tableTransacoes.setBounds(703, 24, -690, 140);
	tableTransacoes.getTableHeader().setReorderingAllowed(false);
	panelTransacoes.setLayout(null);
	JScrollPane scrollPane = new JScrollPane(tableTransacoes);
	scrollPane.setViewportView(tableTransacoes);
	scrollPane.setBounds(10, 21, 691, 154);
	panelTransacoes.add(scrollPane);
}
 
開發者ID:alexferreiradev,項目名稱:3way_laboratorios,代碼行數:18,代碼來源:OperacoesBanco.java

示例2: loadScene

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