Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help with multiple screens  RSS feed

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a MidLet which needs to display the next screen when a command button is clicked.
the problem i am facing is that the next scren too has command buttons and a class can have only one commandAction method.
so how do i implement functionality for command buttons on multiple screens with the same name?
plz help.
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the names to protect the innocent?

Mark
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does "next screen" mean a different displayable (form or canvas)? If so, your CommandAction method can test for that, because the displayable is an argument to the method. (Or you could nominate a different object to be the command listener for your next screen.)

If you're using the same displayable, and changing its contents to make it the "next screen", then you need to have a flag or state code or something similar as an instance variable, and test that in your CommandAction method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!