Hi all,
Well, maybe my doubt could not sounds so serious... but the point is that I don't have problems when using, for example, a Form. I mean, if I create a String like:
public class FormText extends Form {
[...]
StringItem text = new StringItem(null,"text part 1" + '\n' + "text part 2" + '\n' + "text part 3");
append text;
[...]
}
i have no problems, and return is represented correctly. But if I use Canvas instead, it doesn't work:
public class CanvasText extends Canvas{
[...]
String text = "text part 1" + '\n' + "text part 2" + '\n' + "text part 3";
[...]
protected void paint(Graphics g){
g.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
g.drawString(text,x,y,Graphics.TOP|Graphics.LEFT);
}
}
I would be grateful if any of you could let me know how to represent 'carriage return' when using a String attribute in a Canvas class like this one.
Regards.

Reply With Quote

