File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Reading file to JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Reading file to JTable" Watch "Reading file to JTable" New topic
Author

Reading file to JTable

Mike Brooks
Greenhorn

Joined: Oct 07, 2007
Posts: 14
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

Joined: Jun 13, 2009
Posts: 2157
    
    7
Works perfectly for me. I get a table with 4 columns and 4 rows.
 
 
subject: Reading file to JTable
 
Similar Threads
jtable, table model, column headers
Readind and Writing Contents of JTable in txt file
Timer not happening in this example
JTable Dynamic - Urgent
JTable