.getCursor().getType()

doesn't tell what the current cursor is, even if the cursor is over the frame. That method only returns what the mouse would be if it was over that JFrame, JComponent, etc....