Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

writing JTable into a text file

 
Harini Kumaresan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to java ranch and i have been learning java for the past 1 month. Now am trying to write the JTable to a text file. I have added a checkbox at the last column. So only those rows whose checkboxes are selected will get written to the separate files. I have written the code but i get 69 errors. All of them are identifier expected error and ; expected error. I also got illegal start of expression error at private Object GetData(JTable table1,int row_index, int col_index) and public static void main (String s[]) . I have checked all semi colons and the number of closing and opening braces. But i cant fix those errors. Please could someone help me out ? Thanks!
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have lots of errors in your code - missing () for your constructor, missing end of method braces } in few places, calling setResizable(false); on an object that is not JFrame instance, etc etc etc. Just took a short look, maybe someone will be more willing to help you further.

Even if you manage to correct errors in your code I would certainly recommend you don't proceed with this example, or Swing in general (for now).

I am new to java ranch and i have been learning java for the past 1 month.

1 month of working with Java is certainly not enough to work with Swing, and is the obvious proof for that. You are still not so comfortable with basic Java constructions, so if I were you I would work on those first.
 
please buy this thing and then I get a fat cut of the action:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!