我有一個自定義的EDITFIELD黑莓EditField中的錯誤
public class Custom_EditField extends EditField {
int width, row;
Custom_EditField(long style, int width, int row) {
super(style);
this.width = width;
this.row = row;
}
protected void layout(int width, int height) {
width = this.width;
height = this.row;
super.layout(width, Font.getDefault().getHeight() * row);
super.setExtent(width, Font.getDefault().getHeight() * row);
}
public int getPreferredHeight() {
return Font.getDefault().getHeight() * row;
}
public int getPreferredWidth() {
return width;
}
public void paint(Graphics graphics) {
super.paint(graphics);
graphics.setBackgroundColor(Color.GRAY);
graphics.clear();
graphics.setColor(Color.BLACK);
int labelWidth = getFont().getAdvance(getLabel());
graphics.drawRect(labelWidth, 0, getWidth() - labelWidth, getHeight());
graphics.drawText(this.getText(), 0, 0);
}
}
當我在EditField中鍵入完整行字,就會造成和錯誤。它似乎不能自動轉到下一行。
「它會導致一個錯誤」,你可以解釋你得到哪些錯誤?另外[SSCCE](http://pscode.org/sscce.html)會有所幫助。 – Howard
'0:21:21.476:應用程序錯誤104 0:21:21.478:Uncaught:StackOverflowError' –