[Bill's Home]
[Old Page]

 Design  | SFC  |  NOS  |  Code |  Diary  | WWW |  Essay |  Cisco | [Home]

 

Quick links

WinSock in Visual Basic
WinSock multiserver
Java (Pocket PC)
DHTML
CSS
Flash/XML
ASP
PHP
JavaScript
Java
Delphi
RSA
WAP
Java Socket Programming
Subnetting
RS-232
Subnetting
Word
Design Tips

Source Code

Pascal
Java
C Programming
Applied PC Interfacing
WinSock client
WinSock server
FTP client
HTTP client
Java client/server
HTTP client
Subnetting in VB
RS-232 in VB
WinSock Multiserver

 

 

 

 

Next page >>

Java, as shown in the previous design page, runs well on Pocket PC devices. On my system I have installed the JeodeRunTime, which is an implementation of Personal Java 1.2. It supports the insertion of applets in WWW pages, and a stand-alone Java VM (Virtual Machine) which allows Java programs to run on the Pocket PC. The following pages emulate Java programs on a Pocket PC:

 

// Source Mastering Java, Bill Buchanan.

import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class chap10_02 extends Applet implements ActionListener
{
String Msg=null;
TextField tfield = new TextField(20);

public void init()
{
add(new Label("Enter your name"));
add(tfield);
tfield.addActionListener(this);
}
public void actionPerformed(ActionEvent event)
{
Msg=tfield.getText();
repaint();
}
public void paint(Graphics g)
{
if (Msg!=null)
g.drawString("Your name is:" + Msg,30,120);
}
}

 

// Source Mastering Java, Bill Buchanan.

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class chap10_03 extends Applet
implements ActionListener
{
String Msg=null;
TextField tfield1 = new TextField(20);
TextField tfield2 = new TextField(20);
public void init()
{
add(new Label("Enter your name"));
add(tfield1);
add(tfield2);
tfield1.addActionListener(this);
tfield2.addActionListener(this);
}

public void actionPerformed(
ActionEvent event)
{
Msg=tfield1.getText();
tfield2.setText(Msg);
}
}

 

// Source Mastering Java, Bill Buchanan.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class chap10_04 extends Applet
implements ActionListener
{
String Msg=null;
TextField tfield1 = new TextField(20);
TextField tfield2 = new TextField(20);

public void init()
{
add(new Label("Enter your name"));
add(tfield1);
tfield1.setEchoChar('*');
// this is setEchoCharacter() in Java 1.0
add(tfield2);
tfield1.addActionListener(this);
tfield2.addActionListener(this);
}

public void actionPerformed(ActionEvent event)
{
Msg=tfield1.getText();
tfield2.setText(Msg);
}
}

 

// Source Mastering Java, Bill Buchanan.
import java.applet.*;
import java.awt.*;
import java.lang.String;

public class chap11_01 extends Applet
{
String str1,str2;
TextField tfield1 = new TextField(20);
TextField tfield2 = new TextField(20);
TextField tfield3 = new TextField(20);
Button comp = new Button("Compare");
Button quit = new Button("Quit");

public void init()
{
add(new Label("Enter two strings"));
add(tfield1); add(tfield2);
add(new Label("Comparison:"));
add(tfield3);
add(comp); add(quit);
}
public boolean action(Event evt, Object obj)
{
if (evt.target.equals(comp))
{
str1=tfield1.getText();
str2=tfield2.getText();
if (str1.equals(str2))
tfield3.setText("Same");
else tfield3.setText("Different");
}
else if (evt.target.equals(quit))
System.exit(0);
return true;
}
}

Java is a powerful programming language which runs well on any type of device, and is especially usage in mobile devices. Microsoft are busy developing .NET for Windows CE, but it'll take them a while to fully develop it for as many devices as Java currently supports.

 

 
 

Design  | SFC  |  NOS  |  Code |  Diary  | WWW |  Essay |  Cisco | [Home]