本文整理汇总了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);
}
示例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);
}