How do I view error messages for my Java applet?

2020-03-20 05:55发布

问题:

While trying to answer a applet question, the OP didn't know how to view error messages for his applet. It's been a while since I did this myself and I didn't find any step-by-step instructions for doing it, so I am posting a question and answer here for future generations.

回答1:

Windows:

  1. Double-click on the Java icon in the System tray next to the clock in the lower right corner. This will open the Java Control Panel.

  2. Click on the Advanced tab.

  3. Click on the + next to "Java Console" then click on "Show the Console".

The Java Console will display any stacktraces showing error messages from thrown Exceptions. You can also add System.out.println() calls to your applet code to print your own custom messages in the console.