Saturday, 31 August 2013

Java - How to get full Exception Message

Java - How to get full Exception Message

How do I get full exception message in Java?
I am creating a Java Application. If there is a runtime exception, a
JDialog with a JTextArea will pop up. I tried to make a runtime exception
in my application, but the textarea show the exception message like this
=>
java.lang.ClassNotFoundException: com.app.Application
I want my textarea show the exception for example

Here is some part of my code surrounded by try & catch
String ex = e.toString();
this.addText(ex);
I had tried e.getLocalizedMessage() & e.getMessage()... both of them
doesn't work

No comments:

Post a Comment