I have the following code:
public class noEs_HardyException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public noEs_HardyException() {
super("El numero NO es Hardy Ramanujan! ");
}
}
But I want that every time it is called it shows its message in a JOption and not in the console, could it?
Directly from exception no. But like any exception you can put it in a
try/catch
and in thecatch
display of the JOption: