Tuesday Jun 03, 2008

Draggable Applets - 6u10

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.   

About

Hi, I am Vaibhav Choudhary working in Sun. This blog is all about simple concept of Java and JavaFX.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today