File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading file to JTable

 
Mike Brooks
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i trying to read a file into a JTable but when i do so instead of getting many different columns I am only get 1. does any one know where i am going wrong

The first line of the data file contains the column names. Fields are separated by the "|" character.

[customers.dat]



[DataFileTableModel.java]


[DataFileTable.java]
 
Rob Camick
Ranch Hand
Posts: 2473
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works perfectly for me. I get a table with 4 columns and 4 rows.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic