Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
Generally spoken you can throw an exception like this: throw new MyException(); That's all. For the action performed part you can implement ActionListener. There are other less generic approaches if you elaborate on after which action you want to throw the exception...
25th Feb 2020, 6:21 PM
Tashi N
Tashi N - avatar