• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 79977
396
  • 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.
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic