Draggable Applets - 6u10
Tuesday Jun 03, 2008
JDK 6u10 is one of the major attractions in JavaOne 2008. 6u10 came with tons of features like:
1. Kernel JRE download
2. Draggable Applet
3. Improving JS support
4. Better Vista Support
... and many more.
I am here writing the MOST simple example for draggable applet. Off course, Hello World :-). Here is the code:
import java.awt.*;
import java.applet.Applet;
public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello World",50,50);
} // end of paint
} // end of applet
One line code change in the HTML file:
<APPLET CODE="HelloWorld.class" WIDTH=200 HEIGHT=100>
<PARAM NAME="draggable" value="true"/>
</APPLET>
And now you can see how applet will come out of the browser and runs as a different process. Closing browser will not going to make any effect on applet life cycle.


You can clearly see the MS Windows in background :) and a very cute close button with the applet, independent applet. And off course a different process in task bar.
Tags: 6u10 applet code draggable features java javaone2008














