File Compare and Highlight - Java [closed]

坚强是说给别人听的谎言 提交于 2019-12-20 02:08:06

问题


I want to compare two text files and want to highlight the differences. Can any one of you help me in doing that thro Java program.

Thanks in advance.


回答1:


The google-diff-match-path library seems to provide the functionality you need. Here's a demo of it in action.




回答2:


In Eclipse right click on filename in navigator bar, then select "Compare With".




回答3:


Copying one of my answers from a related question:


I would go for netbeans diff api.

  • How to use the diff api in netbeans and,
  • NetBeans Diff API

From the later url:

Although not a visual implementation, you also have a translation of gnu diff in java.



来源:https://stackoverflow.com/questions/3573480/file-compare-and-highlight-java

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