java-melwuitlwuit-formlwuit-layoutslwuit-list

How set scrolling only for BorderLayout.CENTER?


I have top bar, list and bottom bar.

this.setLayout(new BorderLayout());
this.addComponent(BorderLayout.NORTH, bottomBar);
this.addComponent(BorderLayout.CENTER, list);
this.addComponent(BorderLayout.SOUTH, bottomBar);

List is very long. bottomBar and bottomBar is hide. Scrolling is on the full screen. How to make that scrolling was only for BorderLayout.CENTER. bottomBar and bottomBar will be visible.


Solution

  • Disable the scrollable in the Form. For example do like this,

    Form f = new Form();
    f.setLayout(new BorderLayout());
    f.setScrollable(false);
    f.addComponent(BorderLayout.NORTH, new Label("Top bar"));
    f.addComponent(BorderLayout.CENTER, list);
    f.addComponent(BorderLayout.SOUTH, new Label("Bottom bar"));
    f.show();