Reading text from a text file and storing it in Jtable [closed]

孤者浪人 提交于 2019-12-20 08:06:34

问题


Is there any way to read from a text file and store the contents in a Jtable? I've got a text file that contains certain information about some processes. It's like a table that has columns and respective values. Is it possible to take the contents of the .txt file and display it in the form of Jtable? I'm using Eclipse and Window Builder. Any help would be highly appreciated. Thanks!


回答1:


I would look into the tutorials from Oracle:

  • Reading/writing text files

  • JTable Tutorial

When you get the data from the text file you would need to put it into a 2D Array and use that 2D array (along with the columnNames array) to create a new JTable Object. (more details are found in the JTable Tutorials)



来源:https://stackoverflow.com/questions/11000568/reading-text-from-a-text-file-and-storing-it-in-jtable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!