问题
I am currently developing a java program where I need to show the difference between two text. Is there any library available for visually show the difference, that is the diff output in my java program or how can I do so. Any suggestion will be very helpful for me.
回答1:
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.
回答2:
JMeld is a library http://keeskuip.home.xs4all.nl/jmeld/ we have used successfully in our smartGENERATOR product.
The latest version 2.1 is available via * http://sourceforge.net/projects/jmeld/
JMeld 2.1 is available on the central maven repository http://search.maven.org/#artifactdetails|org.jmeld|jmeld|2.1|jar
<dependency>
<groupId>org.jmeld</groupId>
<artifactId>jmeld</artifactId>
<version>2.1</version>
</dependency>
来源:https://stackoverflow.com/questions/2887115/visually-show-diff-output-in-a-java-program