Hello, I have problem creating JTable, which will show every second some text. I make MainView, place JTable and have Class "TableHandler(JTable table) implements Runnable" which is supposed to add some text in intervals to JTable ... Here is run method :
public void run() {
for (int i=0; i<5; i++) {
table.setValueAt("text", i, i);
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
The problem is, that MainView wont "show" until Jtable is filled with data, so user doesn't see filling :-(
EDIT : more code
public MyView(SingleFrameApplication app) {
super(app);
initComponents();
// log of GUI stuff here
TableHandler th = new TableHandler(myTable);
th.createTable(); // just loads data
Timer t = new Timer(100,new ActionListener() {
public void actionPerformed(ActionEvent e) {
th.run();
}
});
t.start();