Click to See Complete Forum and Search --> : (Java) IDE that can export code with syntax coloring
I'm looking for an IDE that can export the code that I have written as text that already has the syntax colored. It's not important which set of colors is used as long as it is a fairly standard one. I am currently using JCreator, and this is one of the few features that I'm missing.
As long as my syntax is colored in MS word without me having to color every single word manually, I am happy.
My other requirement is that it runs in Windows, as I currently don't have a Linux/Unix machine.
edit: It doesn't necessarily have to export as text. If it exports as some other format (png?), that's fine too.
To get the color coding, you'll want HTML output. I'm not familiar with an IDE that will do this (since I rarely use IDEs for Java), but one tool I've used a lot is Java2HTML (http://www.java2html.com/). Hopefully that will work with Word.
One other interesting thing is that copy and paste from Visual Studio into Word will retain the formatting, including color. If you have Visual Studio, try loading your Java code in its editor and see how it looks.
hu flung dung
03-08-2007, 03:14 AM
To get the color coding, you'll want HTML output. I'm not familiar with an IDE that will do this (since I rarely use IDEs for Java), but one tool I've used a lot is Java2HTML (http://www.java2html.com/). Hopefully that will work with Word.
One other interesting thing is that copy and paste from Visual Studio into Word will retain the formatting, including color. If you have Visual Studio, try loading your Java code in its editor and see how it looks.
There are quite a few differences between Microsoft's J# and Sun Microsystems's Java. Hence, copying into Visual Studio probably wouldn't work.
I take it you don't do much Java programming. Do you code in Notepad or what?
Anyway, here's a Java applet that generates HTML code for Java syntax coloring. The website posted previously requires you actually install the application, whereas this can run within your browser:
http://www.java2html.de/applet.html
After doing this, copy the code it generates to a *.htm file, open it in your web browser, then copy-paste the highlighted Java code into MS Word.
There are quite a few differences between Microsoft's J# and Sun Microsystems's Java. Hence, copying into Visual Studio probably wouldn't work.
Actually, it recognizes all the standard Java classes and will highlight them as expected. I've used this a few times for my own work, but results may vary so it's worth a try. Copy and paste from VS is a lot easier than messing with HTML and Word. Plus with VS2005 the color scheme is fairly standard.
I take it you don't do much Java programming. Do you code in Notepad or what?
I used to do a good bit of Java programming, but have less time now since I'm supposed to be management and not writing code. I use Textpad and a command prompt for the small projects I still do. Syntax highlighting is all I really need along with the ability to open several files at once. Eclipse is slow and cumbersome and NetBeans gets awkward in its code generation. I've always designed GUIs on the fly w/o an IDE - sometimes it's tedious, but often you'll end up with much simpler and more usable designs than if you're allowed to drag and drop and re-arrange ad nauseam.