当我尝试将我添加JTable
到我的框架时,我收到此错误:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
import javax.swing.table.AbstractTableModel;
import java.util.List;
import java.util.ArrayList;
public class tablaFormato extends AbstractTableModel {
List<String[]> topFives = new ArrayList <String[]>();
@Override
public int getColumnCount() {
// TODO Auto-generated method stub
return 5;
}
@Override
public int getRowCount() {
// TODO Auto-generated method stub
return 5;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
Object resultado = topFives.get(rowIndex) [columnIndex];
return resultado;
}
}
问题出在resultado
但我不知道我做错了什么。