Restore focus to Java Applet when Browser/Tab gains focus

前端 未结 1 1336
梦毁少年i
梦毁少年i 2021-01-24 14:39

I have an applet running in a browser tab. When I switch to a different tab in the same browser, or ALT-TAB to another application entirely, the applet loses focus. When I retur

相关标签:
1条回答
  • 2021-01-24 15:18

    I believe java has the requestFocus() method. It's in the Component class, so your JPanel or whatever you are using may be able to use this.

    For the javascript part, this is what a quick googling reveals: http://www.raditha.com/java/javascript.php. I hope it helps you!

    0 讨论(0)
提交回复
热议问题