public JTable(Vector rowData,
              Vector columnNames)
rowData里面应该是放的vector,每个vector元素包含对应行的全部列值

解决方案 »

  1.   

    public JTable(Vector,Vector)
    其中第一个Vector是包含所有Table中的值;
    第二个Vector是Table中列的名称
      

  2.   

    public JTable(Vector rowData,
                  Vector columnNames)
    Constructs a JTable to display the values in the Vector of Vectors, rowData, with column names, columnNames. The Vectors contained in rowData should contain the values for that row. In other words, the value of the cell at row 1, column 5 can be obtained with the following code: ((Vector)rowData.elementAt(1)).elementAt(5);Parameters:
    rowData - the data for the new table
    columnNames - names of each column
    Vector v1=new Vector();
    Vector v=new Vector();
    Vector arow = new Vector();for(int i=0;i<3;i++)
    {
    arow.add(""+i);
    }v1.add(arow);......
      

  3.   

    Thanks
    I will try after lunch.