if you know a particular block of code can cause potential problem then surround that block of code with try catch.
To show where exactly a particular exception occurred in catch block use : e.printStackTrace();
This block of code will always run weather you have exception or not.
When there is a requirement where we press Key Down key in try block and
weatherwe get erroror not our program need to do Key Up.