Question:

JTable and XML file

by  |  earlier

0 LIKES UnLike

 Tags:

   Report

1 ANSWERS


  1.  Have u tried something like:

    For row major xml document:

    String xml = "";

    for(int i = 0; i < jt.getRowCount(); i++)

    {

    xml+= "<row number = '" + i + "'>\n";

    for(int j = 0; j < jt.getColCount(); j++)

    {

    xml+= "<col number = '" + j + "'>" + jt.getValueAt(i,j) + "</col>";

    }

    xml += "</row>

    }

    //Then save xml to file.

    For column major XML document just swap the two loops round.

    Hope this helps

You're reading: JTable and XML file

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.