Im trying to add a row during runtime but it keeps breaking. This is just a simple test to get everything working. It only will show everything once it has added everything to the table, but sits with a black window until then.
public static void main(String[] args) throws IOException, InterruptedException{
JFrame dashboard = new JFrame("Dashboard");
dashboard.setVisible(true);
dashboard.setTitle("Dashboard Information");
dashboard.setBounds((960 - 250), (540 - 250), 500, 500);
DefaultTableModel model = new DefaultTableModel();
JTable table = new JTable(model);
dashboard.add(new JScrollPane(table));
model.addColumn("Col2");
model.addColumn("Col1");
model.addColumn("Col3");
model.addRow(new Object[] {"test", 1, "test"});
for (int i = 0; i < 10; i++) {
model.addRow(new Object[] {"test2", 2, "test2"});
Thread.sleep(100);
}
dashboard.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
dashboard.pack();
}