0

im trying to follow this, but got no luck. I'm using treeItem or Choicegroup and it can be selected but can't be clicked, like when clicked, it will go to the next page.

I don't wanna use X and Y coz my Item is dynamic which it was generated through XML. therefore, the item location will be changed. I want a touch pointer for a specific item like the choice group that Im using.

http://www.enough.de/products/j2me-polish/documentation/lush-ui/touch-support.html#gesture-click

  • Welcome to Stack Overflow! We encourage you to [research your questions](http://stackoverflow.com/questions/how-to-ask). If you've [tried something already](http://whathaveyoutried.com/), please add it to the question - if not, research and attempt your question first, and then come back. –  Oct 08 '12 at 06:55
  • Hi, yes I did. fire key using key pressed is already working. But the touch pointer is not. – DeeJay Nacpil Oct 08 '12 at 07:43

1 Answers1

0

You have Choicegroup and you want that on click of item it should go to next page then: you can use :

choicegroupname.addCommand(command of Command.OK type, say commandOpen);

then,you can set setItemCommandListener to commandOpen and in commandAction you can traverse choicegroup so that you can get focused index and you do your code there,then break.Hope this helps.

you can do this like:

    commandOpen.setItemCommandListener(new ItemCommandListener() {
        public void commandAction(Command cmd, Item arg1) {
            //size will be count of items
            for(int i=0 ; i < size ; i++){
                if(choicegroupname.focusedIndex== i){
                    //Do your code
                    return;
                }
            }
        }
    });
vITs
  • 1,651
  • 12
  • 30