I created one customUi class in that im creating 3 fiels as 1 label and two button fileds….
so i m creating the customui and passing the filed names…
like
public class CustomTextField extends Manager {
Field field ;
//passing 3 names to the construcor
protected void sublayout(int width, int height) {
// TODO Auto-generated method stub
int fieldCount = getFieldCount();
int screenWidth = Display.getWidth();
int yOffset =0;
for(int i=0; i<fieldCount; i++)
{
field= getField(i);
layoutChild(field, screenWidth, 100 );
setPositionChild(field, (screenWidth-field.getWidth())>>1, yOffset);
yOffset += field.getHeight()+5;
}
setExtent(screenWidth, yOffset);
}
protected void paintBackground(Graphics g) {
if(field.isFocus())
{
//g.setBackgroundColor(Color.ALICEBLUE);
int oldColor = g.getColor();
g.setColor(Color.DARKBLUE);
g.drawRoundRect(0, 0, getWidth(), getHeight(), Graphics.ALL_ROUNDED_RECT_CORNERS, 60, 60);
g.setColor(oldColor);
}
}
Don’t override
paintBackground(Graphics g)inside of the manager. Override it inside of the child field class. It’s responsibility of a child field how to present its focused state.