JFugue in an Applet Deployed in a JNLP File

Here is a JEditorPane in an applet. I can type in JFugue notation and press Play and then the JFugue API is used to play the notes in the background via the JDK 6 SwingWorker class, so that you can scroll in the JEditorPane while the music is playing:

That's just a demo of any old applet. That's not the point of this blog entry. The point is the deployment of the notoriously clunky applet technology. Let's take a look at the applet's tags in the JSP file that launches it. Take note especially of line 21, which sets the JNLP file that actually launches the applet:

Also take note of the fact that you can set JVM arguments... on a per-applet basis! And here's the JNLP file, with line 11 specifying the location of the JAR, which used to be done in the applet tag, above. So, clearly, the JNLP file has taken over the responsibility of loading the applet JAR:

And performance? Couldn't be better. What about those wacky dialogs that you'd get whenever you load an applet? And the freezing of the browser? Forget about those, file them away as history. Seriously. None of that's anywhere to be seen anymore. All you need is JDK 6 Update 10 (Beta, or some dev build), together with FireFox 3 (also Beta, or some dev build). All this and more, together with a list of demos you can look at once you're all set up, in Applets Reloaded: An Overview of New Tags and Demos on Javalobby.

Comments:

May I suggest a topic for next entry? :) "Separation of api and implementation in netbeans (platform) modules". I am already working on some GUI, that displays data provided by another module. I would like to be able to have several different implementations of backend provider (let's say: "remote provider", "local provider", "mock provider") and be able to exchange them depending on my needs. In normal app I would use local or remote providers. But when testing GUI I would use "mock" one.
Any hints for literature regarding this topic is also welcome :)

regards

Posted by Ihs on April 10, 2008 at 11:51 PM PDT #

There's a complete 4 part tutorial on this topic, starting with part 1:
http://platform.netbeans.org/tutorials/60/nbm-selection-1.html

Posted by Geertjan on April 11, 2008 at 02:02 AM PDT #

I love it! And not just because of the JFugue bit. Making the Java plugin for browsers work seamlessly is critical if Java is going to have a role in the world of web-deployed software. I was always unhappy that Java applets were viewed with limited credibility, and I'm glad to see that's changing.

And, shameless plug... a new version of JFugue has just been released!

Posted by David Koelle on May 01, 2008 at 12:21 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today