0

How to scroll the container without using default method called

setScrollable(true),
setScrollableX(true), 
setScrollableY(true).

Here my code,

btnLeft = new Button(imgLeft);      

btnRight = new Button(imgRight);

Container menuContainer = new Container(new BoxLayout(BoxLayout.X_AXIS));

 String[] menuArray = {"ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX"};
 for (index = 0; index < menuArray.length; index++) {
            btnMenu = new Button((String) locale.get(menuArray[index]));
 menuContainer.addComponent(btnMenu);
        }

 menuContainer.setScrollableX(true);

It should move to right & left while clicking right & left button.

Can any one say is it possible in this LWUIT-1.5?

selladurai
  • 6,491
  • 14
  • 56
  • 88

1 Answers1

1

It will be helpful if you can tell us how you want to build your interface. So, I have tried it with setScrollabeX and it works, but I'm navigating using the focus. If you want to click the Button and make the scroll, you should put in the functionality of the Button something like this:

In the action of the Button Right, you must set the focus to the Button in the right side of the Container and vice versa. Use the Form method setFocused(put the Component here) or using the Button method requestFocus()

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Mun0n
  • 4,438
  • 4
  • 28
  • 46