I am posting what I think is relevant code.
In table class I have :
class Table extends AbstractTableModel { private List<String> columnHeaders; private List<Object> tableData; public Table(SortedSet<String> oznake, List<Object> aRows) { columnHeaders= new ArrayList<String>(oznake); tableData= new ArrayList<Object>(aRows); System.out.println(" tableData:" + tableData.size() + " "+ tableData); } public int getColumnCount() { return columnHeaders.size(); } public int getRowCount() { return tableData.size(); } public Object getValueAt(int row, int column) { List rowData = (List)(tableData.get(row)); return (String)rowData.get(column); } public String getColumnName(int column) { return (String)(columnHeaders.get(column)); } }
In XmlRead I have:
I get from table class:
tableData:3 [[2007-01-01, 27.485, 156.93, 0, 1.3170], [2019-05-06, 25.715, 0, 124.13, 1.1199], [2019-05-09, 25.718, 122.91, 0, 1.1193]] Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap') at irose.IroseTable.getValueAt(IroseTable.java:71)
It looks as the problem is the line:
I can not figure it out why. How can I cast String to List or should I do something else?