Here you go: https://docs.oracle.com/javase/tutorial/deployment/applet/in...
I remember using it to implement hardware key security for a website. A Java Applet loaded a JNI library, after exploiting a JRE security bug to escape confinement, which interacted with the hardware key. The JavaScript then handled all the "browsery" stuff like setting cookies.
That was in 2001...