• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Store contents from JTable into a text file.

 
Sherly Changappa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
I have written a swings form with 5 text boxes and a button. When i click the button save, the data entered is being displayed in the table. Now i want to store the data shown in the table into a text file. Can anyone please help me with this code. I am still a java beginner and have very less idea about java coding. After lot of surfing, i was able to do the table part. I am attaching the code done so far. Please excuse if i have done some silly mistakes. Really in need of your help. Thanks in advance..



 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post your code inside code tags. It would be easier us to read. Now coming to your question, you could have a function like this to store the contents in file.



You can call the above function once you assign the data to the table.
 
Sherly Changappa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir. Your help is greatly appreciated. I'm sorry for the inconvenience made. I'm new to this forum and so dint know the format of posting. Will keep that in mind next time.
Can you please give me a sample snippet of the code you just mentioned. Finding hard to understand so.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50168
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:Could you please post your code inside code tags. It would be easier us to read. . . .
He did, but didn’t use them correctly. Unfortunately when I corrected the code tags, it simply highlighted the lack of indentation.

You didn’t comment on the empty catch block. Nor on trying to catch an Exception as opposed to a specific type of Exception. Nor on catching Exception when it was not declared in a throws clause.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic