You can draw a picture by using the j2-based image as the anchor. The positions of the anchor are as follows:
Note:
1. Pass test verification:
G. drawString ("text", x, y, 0 );
=
G. drawString ("text", x, y, Graphics. LEFT | Graphics. TOP );
0 is the default value. The default value is the position that can be normally displayed at the first point when the phone is blank, that is, Graphics. LEFT | Graphics. TOP.
2. The parameter "vcenter" is used for Image purposes. This anchor is based on "Image". If you want to draw a "String", the positioning parameter "vcenter" is invalid;
3. Positioning coordinates are a set of two parameters, each of which is an int value. The specific values are listed below;
Int A = graphics. Left | graphics. Top;
Int B = graphics. Left | graphics. baseline;
Int c = graphics. Left | graphics. vcenter;
Int d = graphics. Left | graphics. bottom;
Int e = graphics. Right | graphics. Top;
Int F = graphics. Right | graphics. baseline;
Int G = graphics. Right | graphics. vcenter;
Int H = graphics. Right | graphics. bottom;
Int I = graphics. hcenter | graphics. Top;
Int J = graphics. hcenter | graphics. baseline;
Int K = graphics. hcenter | graphics. vcenter;
Int L = graphics. hcenter | graphics. bottom;
System. Out. println ("A is:" + );
System. Out. println ("B is:" + B );
System. Out. println ("C is:" + C );
System. Out. println ("d is:" + D );
System. Out. println ("e is:" + E );
System. Out. println ("F is:" + F );
System. Out. println ("G is:" + G );
System. Out. println ("H is:" + H );
System. out. println ("I is:" + I );
System. out. println ("j is:" + j );
System. out. println ("k is:" + k );
System. out. println ("l is:" + l );
The output is as follows:
A is: 20
B is: 68
C is: 6
D is: 36
E is: 24
F is: 72
G is: 10
H is: 40
I is: 17
J is: 65
K is: 3
L is: 33
-- End --