I am trying to populate a JTable with data from a text file. In the text file, the fields are separated by tabs (but could be separated by commas, spaces, etc). How is this done. Thanks for your help, I am a Java rookie!!!
what u can do is like this. 1) read a line from the file using BufferedReader 2) Tokenize this line using StringTokenizer by default StringTokenizer will separate tokens on the basis of tab and space character. 3)Now you consider each token one by one and check if it contains a , ( comma ) . in case it contains comma then you further tokenize this token using , as delimiter and so on. untill you reach the actual field. 4) keep on adding the final token to a Vector 5) and pass this Vector to JTable Constructor. regards Deekasha
Post by:autobot
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, the permaculture playing cards