I'm writing a programm in which I need to generate a diff and display the result. Is there any GUI component out there, with which I can easily accomplish this task, or do I need to hack something for myself?
I'd prefer using a Swing component, but any other technology will be fine, too.
Up to now, it is my preferred solution, to output HTML to a JEditorPane - as a related project I'm working on is also using HTML to generate and display the reports. As I can't use NetBeans, I decided to go with JDiff lib, mentioned in an earlier answer. Thanks for providing all the answers!
1
As far as i know there is no component for this. Any modern IDE does this job today, also source control plugins have this function, many of them are open source so you can get the idea by viewing them. But it would be hard.
Maybe have a look at the JDiffPlugin for jEdit (it might be easier than digging Eclipse / NetBeans / IntelliJ source code).
Or have a look at the Java diff viewer Component? thread, it seems that someone had similar needs and you will find a solution based on incava.org's Diff implementation (the location of sources changed so I'm putting the new location below):
I know IntelliJ IDEA can do this, and they've recently released an open-source community edition, so the code is in there somewhere. It will probably taken a bit of digging to find the relevant code though!