Code:
int[] xpts = { 0, 0, 240, 240 };
int[] ypts = { 0, 240, 240, 0 };
private final int[] cols = new int[]Color.PINK, Color.BLACK, Color.WHITE, Color.GREEN };
private final byte[] ptTypes = new byte[]{Graphics.CURVEDPATH_END_POINT, Graphics.CURVEDPATH_CUBIC_BEZIER_CONTROL_POINT, Graphics.CURVEDPATH_QUADRATIC_BEZIER_CONTROL_POINT,
Graphics.CURVEDPATH_END_POINT};
int [] offsets = {5,10,15,20};
public Test()
{
super();
LabelField titlev = new LabelField("ggfkhfkhkdhkj",LabelField.ELLIPSIS);
LabelField titlew = new LabelField("ggfkhfkhkdhkj",LabelField.ELLIPSIS);
LabelField titlee = new LabelField("ggfkhfkhkdhkj",LabelField.ELLIPSIS);
VerticalFieldManager title1 = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH)
{
public void paint(Graphics g)
{
g.setColor(0x00ffffff);
g.setFont((Font.getDefault()).derive(Font.BOLD,30 ));
int rowHeight = this.getPreferredHeight();
System.out.println("rowHeight:"+rowHeight);
int[] yInds = new int[]{0, 0, rowHeight,rowHeight};
System.out.println("g.getScreenWidth():"+g.getScreenWidth());
int[] xInds = new int[]{0, g.getScreenWidth(), g.getScreenWidth(), 0};
g.drawShadedFilledPath(xInds, yInds,ptTypes, cols, offsets);
super.paint(g);
}
};
title1.add(titlev);
title1.add(titlew);
title1.add(titlee);
add(title1);
}
} i am getting an IllegalArgumentException().
Wht am i doing wrong here.