tags:

views:

34

answers:

1

here is my code and through the source code is not available exception. in the code we require that popup screen that show but the value of the average speed is not show.

class popUpScreen extends PopupScreen 
{
    private EditField _sp;
    // Speed s = new Speed();
    //public double _averageSpeed =s._averageSpeed ;
    StringBuffer sb = new StringBuffer();
    popUpScreen() 
    {   
        super(new VerticalFieldManager(),Field.FOCUSABLE);

        Speed s = new Speed();
        double _averageSpeed =s._averageSpeed ;

        _sp = new EditField(" The Average Speed is: ",""+_averageSpeed );
        add(_sp);
        //Speed._averageSpeed=sb.;
        //sb.append("\n_averageSpeed : ");
        //sb.append(_averageSpeed);
    }
} 
A: 

you should save that VerticalFieldManager you passed to the super; add your label to the manager.

It is not necessary to override the whole class you could do like this:

DialogFieldManager dfm = new DialogFieldManager();
dfm.add(_sp);
PopupScreen  popUpScreen = new BasePopupScreen(dfm, Manager.VERTICAL_SCROLL);
Viele
i require the result as (the average speed is: 45) averagespeed is a variable.but my code through the exception
jutt.chattha
Sorry I might have misunderstood your comment. Could you plz clarify what you are trying to say?
Viele