• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to edit JTable in JEditorPane?

 
Richard Selva
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
In my application I want to show the data in Table format in html . I have to dynamically create the table in html and have to show in the JEditorPane . I want some suggestion to do this .
Is there any code snipet available to create Table fromat in html ?.
Thanks in advance .
selva.
 
Thomas Smets
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
this is little code I did to view all the simple cases of a document in a JEditorPane.
I do not show you how to put one into the other. But as you stated that the table would be in HTML format you can render it straight away !
So the code here below helps you showing HTML in a JEditorPane, no more.

Please read thoroughly !

You will need to have the Log4J classes in you classpath (the version 1.2Beta !). Please also note that the program expects a SimpleHTML.html. In you case thus :

<html>
<head><title>HTML table</title></head>
<body>
<table border="1">
<tr>
<td>Value A </td>
<td>Value B </td>
<td>Value C </td>
<td>Value D </td>
<td>Value E </td>
<td>Value F </td>
</tr>
<tr>
<td>Value A1 </td>
<td>Value B2 </td>
<td>Value C3 </td>
<td>Value D4 </td>
<td>Value E5 </td>
<td>Value F6 </td>
</tr>
</table>
</body>
</html>

Rgds,
[ April 19, 2002: Message edited by: Thomas SMETS ]
 
Richard Selva
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Thomas for your kind reply.
selva.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!