JTextArea JLabel compare two txt. files line by line

妖精的绣舞 提交于 2019-12-02 06:58:17

问题


everybody. I have completed my code two txt files by showing on the same area.

but I want to compare two txt files line by line. and I want to show the differences with Colored lines and finally, The letter or words that are different, different line I'm going to bold.

how can i start?

thanks for now, my code is here.


回答1:


JTextArea might make a suitable view, but you still need to model the differences. I'd look at the Eclipse or NetBeans platforms, or perhaps svnview.




回答2:


You might need to ask user to upload both versions of file.

In the server you need to compare line by line, and store the line numbers of the file differences in another file or location

Then, while displaying, get the line numbers and give them proper decoration (i.e bold etc.).



来源:https://stackoverflow.com/questions/11727448/jtextarea-jlabel-compare-two-txt-files-line-by-line

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