• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Store contents from JTable into a text file.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..



 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 74047
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic