within the browser?

Hi folks,

Been a while. How’s everyone doing?

Here’s a question I could use some collective wisdom on.

  1. Is it possible to get JOGL working within the browser (FF)
    without going thru the applet path?

For example, a FF plug-in that grabs the windows handle of
the browser’s rendering space and let JOGL create a GL context
out of it.

  1. Is it possible to do this via JWS?

If the answer is Yes to both these questions, then it is possible
to allow the app to fill up (and resizable) the browser space and
benefit from JWS’s version control + JRE management.

.rex

Rex: good to hear from you.

For the past several months we have been working on a ground-up rewrite of the Java Plug-In, which provides applet support in the browser. The new plugin has a radically different architecture and is effectively Java Web Start for applets. Multiple applets continue to run in the same JVM instance, but you can request a JRE version or JVM command-line arguments (like -Dsun.java2d.noddraw=true) on a per-applet basis, in which case a new JVM is launched to satisfy those requests.

The new plug-in is available right now for early access testing at https://jdk6.dev.java.net/6uNea.html . Release notes can be found at https://jdk6.dev.java.net/plugin2/ .

As you might imagine, it was designed with the specific goal in mind of executing JOGL content reliably in the web browser. I am pleased to say that we have achieved this goal.

The current build of 6u10 is build 12. The following build, 13, will support launching applets directly from JNLP files. This means that deployment as an applet via the Java Plug-In and deployment as an application via Java Web Start will be basically identical. You can pull in JOGL and other JNLP extensions directly into applets. JRE version requests and JVM command-line arguments specified in the JNLP file apply equally to both applications and applets.

I’m very excited about the possibilities the new plug-in provides and hope you will be too. Please take a look and see whether it satisfies your needs. If so, please try it out and provide feedback on either the Java Plug-In forum at http://forums.java.net/jive/forum.jspa?forumID=77 or on the 6uN early access forum at http://forums.java.net/jive/forum.jspa?forumID=119 .

Demos will be coming in a few weeks that showcase the new JNLP support for applets and what it enables.

Ken, thanks and super glad that you’ve been working
on critically important parts of desktop Java.

Rehashing an already debated-to-death question:
What is Sun’s strategy for dealing with the entirely empty
space of designer-friendly tools (e.g. Flash studio) so
that non-engineers can create media-savvy RIAs on
top of Java? Let’s face it, the current crop of UI tools
are designed by engineers for engineers. This approach
is evidently not going to get desktop Java anywhere
near the RIA space where I think Java can and should
shine in. It is almost funny (and sad at the same time) that
Adobe built its Flex solution on top of Eclipse and released
AIR just a few days ago.


Back to the Consumer JRE. I’ve been following it for
some time and glad that it has reached a milestone.
Seems like Build 13 will be a big one to look forward
to for me.

shwup (if you remember it) will be reborn (the experimental
phase is over) in the next few months incorporating all
the cool stuff you’ve seen and that’s just the tip of the iceberg.
These deployment and version control issues have really
been the achilles heel stopping us from going out in
a big way, so rest assured that we’ll be trying out the EA
builds internally.

.rex

https://openjfx.dev.java.net/

and forthcoming tools for JavaFX Script.

Please get involved in the JavaFX community. There is a lot of development activity within Sun which I’m not sure is reflected in the publicly facing web pages. There will be a lot to show in coming months.

It’s a good build but please keep testing our forthcoming ones. Build 14 (which we’re currently working on) will smooth out several rough edges with the new JNLP support for applets.

That’s excellent. I’d love to see a publicly visible demo of this stuff, even if it requires installation of the 6uN early access builds. We would be glad to send traffic your way by linking to your site from ours.

Ken,

I’ve just installed (offline version) of 6uN b12.

  • Happy to see that it has remained at the 14MB bodyweight.
  • The user experience of the installer, while no showstoppers, still
    feels way to corporate and not consumer-friendly enough.

I ran 4 applets:

  1. http://www.waterlogic.com.sg/smallmedia/gallery/dragonflydemo.html
  2. https://jogl-demos.dev.java.net/applettest.html
  3. http://www.turbulence.org/spotlight/thinking/chess.html
  4. http://www.wefeelfine.org/wefeelfine_pc.html

I did the above in sequence, concurrently, closing and restarting
in random order. Very happy to see that:

  • FF remains alive and never crashed;
  • one JVM instance serving multiple applets in different threadgroups
    work as advertised;
  • applet restart is very fast;
  • all applets work perfectly.

Great work!!

Lastly, please, the tray icon of the JRE needs to be redone
for Windows. It looks too lo-fi and I’m unable to make up the
details or even shape of the Java logo. This is important for the
branding success of Java because this 16x16 block of pixels is
what the user is going to see, remember and mentally connect
it to Java.

.rex

Glad to hear the new Java Plug-In is working well for you.

I completely agree with you. This has been filed as Sun bug 6673428 and will show up on the Sun Bug Database in a day or two. If you have any suggestions on design we would be glad to hear them. I think changing to a black background might help make the red/blue lines in the coffee cup more visible. What do you think?

I tested the applettest as well. Unfortunately it quits with the following exception (Java6U10 b12, both FF and IE):

JNLPAppletLauncher: static initializer
os.name = windows xp
nativePrefix = nativeSuffix = .dll
tmpRootDir = C:\DOKUME~1#####\LOKALE~1\Temp\jnlp-applet\jln2014
Applet Status: Applet geladen
Applet Status: Applet resized and added to parent container
Applet.init
subapplet.classname = demos.applets.GearsApplet
subapplet.displayname = JOGL Gears Applet
Applet Status: Applet initialized
Applet Status: Applet made visible
Applet Status: Starting applet
Applet.start
Applet Status: Applet started
Applet Status: Told clients applet is started
os.name = windows xp
os.arch = x86
processNativeJar: http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl-natives-windows-i586.jar --> C:\Dokumente und Einstellungen#####.jnlp-applet\cache\jogl-demos_dev_java_net\faeb82afc25fdb98fa60c07a7d04e1128ed3c03f\jogl-natives-windows-i586.jar : 60483 bytes written
validateCertificates:
VALIDATE: jogl.dll
VALIDATE: jogl_awt.dll
VALIDATE: jogl_cg.dll
extractNativeLibs:
EXTRACT: jogl.dll(jogl)
EXTRACT: jogl_awt.dll(jogl_awt)
EXTRACT: jogl_cg.dll(jogl_cg)
processNativeJar: http://download.java.net/media/gluegen/webstart/gluegen-rt-natives-windows-i586.jar --> C:\Dokumente und Einstellungen#####.jnlp-applet\cache\jogl-demos_dev_java_net\faeb82afc25fdb98fa60c07a7d04e1128ed3c03f\gluegen-rt-natives-windows-i586.jar : 4778 bytes written
validateCertificates:
VALIDATE: gluegen-rt.dll
extractNativeLibs:
EXTRACT: gluegen-rt.dll(gluegen-rt)
Exception in thread “AWT-EventQueue-4” java.lang.NoClassDefFoundError: Could not initialize class com.sun.opengl.impl.windows.WindowsGLDrawableFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:520)
at javax.media.opengl.GLCanvas.(GLCanvas.java:131)
at javax.media.opengl.GLCanvas.(GLCanvas.java:90)
at javax.media.opengl.GLCanvas.(GLCanvas.java:83)
at demos.applets.GearsApplet.init(GearsApplet.java:19)
at org.jdesktop.applet.util.JNLPAppletLauncher.startSubApplet(JNLPAppletLauncher.java:1904)
at org.jdesktop.applet.util.JNLPAppletLauncher.access$200(JNLPAppletLauncher.java:658)
at org.jdesktop.applet.util.JNLPAppletLauncher$5.run(JNLPAppletLauncher.java:1269)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

It works fine for me. Have you dropped jogl.jar into your JRE?

Thanks Ken!

I’ve followed up with a response at the bug parade.

I suspect the 6uN b12 build is using the old Java 5
image for the tray icon, because I was expecting
to see the new orange version that’s been shipping
with Java 6.

Well, I had it on the classpath. But after removing it, the exceptions still occured.

Right now I updated to b13 and the gears are running :wink: