JTextArea JLabel compare two txt. files line by li

2019-02-28 07:00发布

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.

2条回答
闹够了就滚
2楼-- · 2019-02-28 07:36

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.).

查看更多
手持菜刀,她持情操
3楼-- · 2019-02-28 07:46

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.

查看更多
登录 后发表回答