Swing application for Windows CE and CrE-ME

This is same as Writing Applet Application. The Only thing we need to the followings

Step1:
Take the javax.swing package from http://www.nsicom.com/Default.aspx?tabid=295.

You will get a CAB file, put it on the PDA device and click on it to install. It will fire a dialog box. Select the root folder of the CrE-ME.

Step2:
The write a sample Swing program:

Bellow program also shows how to set a user defined icon left most of the Title bar.

import javax.swing.*;
import java.awt.*;

public class Sample
{

public static void main(String[] args)
{

JFrame frame = new JFrame("Setting an Icon for a frame");
frame.setIconImage(Toolkit.getDefaultToolkit().getImage("icon_confused.gif"));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400,400);
frame.setVisible(true);
}
}

NB: keep your image icon in the same package where the program is.

Finally produce the jar file and keep it in the PDA and run it.

0 comments:

Post a Comment