Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help with multiple screens

 
Joel Karimpil
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the names to protect the innocent?

Mark
 
Alan Walker
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!