Using Java code in your posts

Printer Friendly Version Attach Files

wdavatar?user=leiger
leiger
27 Apr 2010 15:02. Edited 4 times. (Edit, Permalink)

If you want to add Java code to your feature request, you can do that. All threads and replies support both methods displayed here (because we don't use the comments module in this forum!)

The default Wikidot code blocks

[[code type="java"]]
/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
[[/code]]
/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}

A better-looking solution

This solution comes from this page: http://snippets.wikidot.com/code:syntax-highlighter . To find out more about the original creator of this syntax highlighter, click on the blue information icon that appears when hovering your mouse over the code block shown below.

[[include :snippets:syntax-start type=java]]
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
   public static void main(String[] args) {
      System.out.println("Hello World!"); // Display the string.
   }
}
[[include :snippets:syntax-end]]


Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

28 Apr 2010 01:26. Edited 0 times. (Edit, Permalink)
Damn. Found a problem with the second one. Either it's IE7 that I'm using, or it's the corporate network causing problems again. I'll have a look on my laptop later with Google Chrome (behind the same network) and see if I still have the same problem.

I get this popup message:

SyntaxHighlighter

Can't find brush for: java

And then the code is shown on the page without colour highlighting and without any of the cool display elements (hover buttons, background image, etc)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=
(user deleted)

28 Apr 2010 02:53. Edited 0 times. (Edit, Permalink)
It's displaying fine in FF and IE8 on my Win7 Pro laptop.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

28 Apr 2010 03:35. Edited 0 times. (Edit, Permalink)
Working fine on Google Chrome, with Windows 7, behind the corporate network.

I was using Windows XP + IE7 earlier.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

28 Apr 2010 03:39. Edited 0 times. (Edit, Permalink)
IE9 gives me these error messages, and asks me to run the debugger. If I say Yes, I want to run the debugger, IE9 crashes :S

Line: 1
Error: Syntax error in regular expression

and then
Line: 1
Error: Object doesn't support this property or method

Included page "inc:signature" does not exist (create it now)

Post Reply

Add reply on "Using Java code in your posts"

Printer Friendly Version Attach Files

CSS Theme, Images and Code on this website are © Shane Smith 2010-2012. All forum posts by users and documentation licensed under Creative Commons BY-NC-SA 3.0 License.