Very simple question: I have a class which extends from java Robot class, however I have an error in my IDE (netbeans), that I haven’t handled the AWTException for the my class. how can I fix this?
My class is like this:
public class KeyBoard extends Robot{
}
Constructors of the class
java.awt.Robotthrow anAWTExceptionthat requires mandatory handling. So, to solve the problem, declare the constructor of your class to throw anAWTException.For more information, you can read the documentation of the Robot class here.