Page 1 of 1

Is there a method which can handle the exception during the applet execution

Posted: Wed Sep 23, 2015 4:13 am
by user143839285163098
I have finished an applet recently. Now I want to test the sturdiness of this applet.
I want to know if there is a method which can handle the exception during the applet execution.
It is just like

Code: Select all

try {
...
}
catch (Exception e) {
...
}

Any help is much appreciated.

Re: Is there a method which can handle the exception during the applet execution

Posted: Thu Sep 24, 2015 2:26 am
by horse dream
Maybe you can use Transaction API.
Just like this

Code: Select all

    JCSystem.beginTransaction();
   
    // your operations  are between beginTransation() and commitTransation() 
   
    JCSystem.commitTransaction();


Note that if any exception happens before commitTransation() method, everything returns to its original states.