I have an easy question, here is my code:
public TableForResults( Object [] temp, Object [] tk) {
ListModel lm = new AbstractListModel() {
String headers[] = { "a", "b", "c", "d", "e", "f", "g", "h", "i" };
public int getSize() {
return headers.length;
}
public Object getElementAt(int index) {
return headers[index];
}
};
}
well it is not my code, I found on java2s. Here is question, I need to pass the tk array into the AbstractListModel(). I know it is basic question, but I can’t sort it out.
You need to extend AbstractListModel and create your own class which will have a constructor to accept Object[] and then you can do the behaviour you want to do.