> Hello,
> is there an easy way to save ( and get) the contents of a jtable to
> (from) html-tables or ascii?
> Thanks
> Greetings Mark
Yes, something like:
StringBuffer sb = new StringBuffer("<table>");
for(int row = 0;row< table.getTableModel().size();row++) {
sb.append("<tr>");
for(int column =0; column<table.getTableModel().getColumnCount();column++){
sb.append("<td>"+table.getTableModel().getValueAt(row,column)+"</td>");
}
sb.append("</tr>");
}
sb.append("</table>");

Signature
Kind regards,
Christophe Vanfleteren
Mark Trompell - 18 Dec 2003 09:35 GMT
Christophe Vanfleteren schrieb:
>>Hello,
>>is there an easy way to save ( and get) the contents of a jtable to
[quoted text clipped - 13 lines]
> }
> sb.append("</table>");
Okay, thank you. I hoped that there is a "wrapper"-class for this funktion.
To get html-> jtable is a little bit more complicatet i think but I'll try.
Greetings Mark