(Java) IDE that can export code with syntax coloring

Sharky Forums


Results 1 to 4 of 4

Thread: (Java) IDE that can export code with syntax coloring

  1. #1
    Richard M. Nixon '08 PCJ's Avatar
    Join Date
    Jul 2003
    Posts
    8,187

    (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.
    Last edited by PCJ; 03-07-2007 at 11:28 AM.
    +++ F.O.R.U.M. I.L.L.U.M.I.N.A.T.I. +++
    Quote Originally Posted by Zvi
    How come you always choose the wrong side, first HD DVD, now Russians.

  2. #2
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    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. 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.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

  3. #3
    Tiger Shark
    Join Date
    Jun 2001
    Posts
    860
    Quote Originally Posted by rock
    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. 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.
    Last edited by hu flung dung; 03-08-2007 at 03:16 AM.

  4. #4
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Quote Originally Posted by hu flung dung
    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.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •