I have an example:
Object rowData[][] = { { "Row1-Column1", "Row1-Column2", "Row1-Column3" },{ "Row2-Column1", "Row2-Column2", "Row2-Column3" } };
Object columnNames[] = { "Posição", "Nome", "Pontuação" };
JTable table = new JTable(rowData, columnNames);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JScrollPane scrollPane = new JScrollPane(table);
frame.add(scrollPane, BorderLayout.CENTER);
frame.setSize(255, 400);
frame.setVisible(true);
I need to do rowData
get a ResultSet
, do not dominate java, and even now while
could not make rowData
get my ResultSet
if(rs != null) {
while(rs.next()) {
// rowData = ??
}
}