...
6.3.1 Sending a Datagram
To send a datagram, you have to obtain a Datagram object, populate it with the data to be
sent, and invoke the send( ) method. The DatagramConnection interface has four ... following pair of
repaint( ) calls:
repaint(0, 0, 4, 4) ; // Repaint the old location of the block
repaint (4, 4, 4, 4) ; // Repaint the new location of the block
When several rep...
... display) a Canvas from which the attribute
values are obtained, as shown in Example 5-1.
Example 5-1. Getting Display and Canvas Attributes for a Device
package ora.ch5;
import javax.microedition.lcdui.Canvas; ... without having to wait for the paint( ) method to be
called.
5 .4. 1 Lines and Rectangles
The simplest shape you can draw on a Canvas is a straight line:
public...
... packages are provided:
java.io (but not LineNumberInputStream and StringBufferInputStream, which are
deprecated in J2SE)
java.lang
java.lang.ref
java.lang.reflect
java.math
java.net
java.security ...
java.security.acl
java.security.cert
java.security.interfaces
java.security.spec
java.text
java.util
java.util.jar
java.util.zip
J2ME in a Nutshell
221
Figure 6-5. A...
... the information and what type of data is stored there.
A reference is a scalar and can be used anywhere a scalar can be used. Any array element or hash value
can contain a reference (a hash key ... packages.
Each package starts with a package declaration. The package call takes one argument, the name of
the package. Within the scope of a package declaration, all regular identifie...
... O'Reilly at http://java.oreilly.com/. Books
that are of particular interest to J2ME programmers include:
Java in a Nutshell, by David Flanagan
A Java language tutorial and complete API ... Package Contents
308
308
309
310
11. java.io
Package java.io
ByteArrayInputStream
ByteArrayOutputStream
DataInput
DataInputStream
DataOutput
DataOutputStream
EOFException...
... server)
9 04 JAR size mismatch
905 Attribute mismatch
906 Invalid descriptor
J2ME in a Nutshell
54
Table 3-2. MIDlet Packaging Attributes
Attribute Name JAR JAD Value and Meaning
MIDlet-Name ... therefore share the same instances of all Java classes and other resources loaded
into the Java VM. Among other things, this means that data can be shared between
MIDlets, and the...
... right-
clicking on the page in the browser, selecting Properties and then Certificate, and finally
activating the Certification Path tab of the dialog that appears, as shown in Figure 9 -4. As you
can ... and return values.
Inner classes
Groups all of the inner classes and interfaces defined by the class or interface.
For each inner class, there is a single-line synopsis. Each inne...
... created by applying the static
valueOf() methods to a boolean, a char, an array of characters (char[]), an int, a long or
an arbitrary Java Object. With an Object, the String is created using the ... Datagram newDatagram(
int size) throws java.io.IOException;
public abstract Datagram newDatagram(byte[] buf,
int size) throws java.io.IOException;
public abstract Datagram newData...