Regarding setCurrent method in j2me..

Hai all,

I have created three classes like LoginScreen, TextBox and Button. These three classes are extends by Canvas.In LoginScreen class itself i drawn some images,Textbox class itself i drawn some Boxes and Button class itself drawn some butons. When i tried to display all these things in one screen like this..

public void startApp(){

display = Display.getDisplay(this);

screen = new LoginScreen();

display.setCurrent(screen);

display.setCurrent(screen.getUsernameTxt());

display.setCurrent(screen.getPasswordTxt());

display.setCurrent(screen.getTextbox());

display.setCurrent(screen.getTextbox1());

display.setCurrent(screen.getTextbox2());

display.setCurrent(screen.getLoginButton());

}

just its displayed only two items, remaining items are not displayed.But at the time of debugging, its displayed all items in one screen. Can anyone give suggestion to solve this issue..

Thanks/Regards

Krishnan

[1004 byte] By [Bkrishnana] at [2007-11-27 2:34:36]
# 1

setCurrent() is only used to set a "new screen". You can only have one screen on at a time, and setCurrent() is the way to set your "current" screen. A screen can be anything that extends Displayable (like Canvas, List, Form...etc)

it is not used for displaying multiple things on screen at once.

pandora_fooa at 2007-7-12 2:52:09 > top of Java-index,Java Mobility Forums,Java ME Technologies...