Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving od jtable in text format from applet

 
Rakesh Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I want to save a jtable content in the form of .txt (text format) on th desktop.The text table should be properly aligned.
If anybody has any code please share with me.

Thanks in advance
Rakesh
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet will need to be signed in order to be allowed to save files on the client machine: HowCanAnAppletReadFilesOnTheLocalFileSystem

Pure text files do not have much of a layout; are you asking about some structured file format, or do you mean to use a monospaced font, and achieve the formatting by using spaces?
 
Rakesh Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes .

For example,

abcd |efg |
12345 |weqe |

like this.

The logic will come such a way that '|' should come as a colum border such that the spacing we have to adjust ,based on the cell text width.


Rakesh
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the problem is just the formatting? Maybe the http://fixedformat4j.ancientprogramming.com/ library can help.
 
Rakesh Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes , formatting is the problem while writing a table content with delimiters like "|" into text file.

Let me try whatever you given.
Thanks for your information sharing
Rakesh
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic