Is there a way to check if the java has focus?