TextCursorpublic class TextCursor extends Object Class that represents the character index, and (x,y) position
of a text cursor in a TextField |
Fields Summary |
---|
public int | xx, y coordinates | public int | y | public int | widthwidth, height | public int | height | public int | indexarray index | public int | optiondrawing options: can be one of the PAINT_* variables in Text.java | public boolean | visiblewhether or not this cursor is visible | public int | preferredXpreferred x location when traversing vertically |
Constructors Summary |
---|
public TextCursor(int index)Construct a new text cursor with the given array index
this.index = index;
option = Text.PAINT_USE_CURSOR_INDEX;
visible = true;
| public TextCursor(TextCursor tc)Copy a TextCursor object
this(0);
if (tc != null) {
this.x = tc.x;
this.y = tc.y;
this.option = tc.option;
this.index = tc.index;
this.visible = tc.visible;
}
|
Methods Summary |
---|
public void | paint(javax.microedition.lcdui.Graphics g)Paint this cursor in the given graphics context
int stroke = g.getStrokeStyle();
g.setStrokeStyle(g.SOLID);
g.drawLine(x - 1, y - height, (x - 1) + (width - 1), y);
g.setStrokeStyle(stroke);
|
|