hi
ive been trying to code my Jtable do that it updates on the fly as opposed to hard coding it so it is populated on start up...
so far im am initailsing it by :
table = new JTable(mydb.getAllEventQuery(), headings);
where mydb is a class that does all my database query processing and getAllEventQuery returns a Object[][],
headings = {"username","event_id","tsStart","tsFinish");
i have this in an buildGUI method for my app which only gets called once...
I want to have an actionListener to a button so that when pressed the contents of table is re- populated ... but when going through the java API i can't seem to find any methods for JTable which set the data like in a JList where you can do something like:
myList.setListData(vector v);
is there a similar method for JTable ?? or do i have to abandon the way im doing it and go down the more complicated route of defining my own table model??
thanks
mark
ive been trying to code my Jtable do that it updates on the fly as opposed to hard coding it so it is populated on start up...
so far im am initailsing it by :
table = new JTable(mydb.getAllEventQuery(), headings);
where mydb is a class that does all my database query processing and getAllEventQuery returns a Object[][],
headings = {"username","event_id","tsStart","tsFinish");
i have this in an buildGUI method for my app which only gets called once...
I want to have an actionListener to a button so that when pressed the contents of table is re- populated ... but when going through the java API i can't seem to find any methods for JTable which set the data like in a JList where you can do something like:
myList.setListData(vector v);
is there a similar method for JTable ?? or do i have to abandon the way im doing it and go down the more complicated route of defining my own table model??
thanks
mark