Heres the code, as soon as i set _focusable to true, i get the exception
Code:
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
class MainFrame extends Manager{
public boolean _focusable=false;
boolean extent1=true;
int _width=0,_height=0;//for width and height of individual field
int x=0,y=0;//for each field
MainFrame(int x,int y,int _width,int _height) {
super(Manager.VERTICAL_SCROLL|Manager.FOCUSABLE);
this.x=x;
this.y=y;
this._width=_width;
this._height=_height;
}
public int getPreferredWidth()
{
return 260;
}
public int getPreferredHeight()
{
return 160;
}
public void sublayout(int width,int height)
{
System.out.println("width:"+width+"\t height:"+height);
Field field;
int noFields=getFieldCount();
for(int i=0;i<noFields;i++)
{
field=getField(i);
setPositionChild(field,10,10+y);
if(field instanceof CustomRectField){
System.out.println("Drawing RectField"+getExtent().width+"\t"+getExtent().height);
x=((CustomRectField)field).x;
y=((CustomRectField)field).y;
_width=((CustomRectField)field)._width;
_height=((CustomRectField)field)._height;
setPositionChild(field,x,y);
}
layoutChild(field,_width,_height);
//y+=30;
}
setExtent(getPreferredWidth(),getPreferredHeight());
}
public boolean isFocusable()
{
return _focusable;
}
}