如何仅为BorderLayout.CENTER设置滚动?

时间:2011-11-28 10:24:57

标签: java-me lwuit lwuit-form lwuit-layouts lwuit-list

我有顶栏,列表和底栏。

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

List很长。 bottomBar和bottomBar是隐藏的。滚动是全屏幕。 如何进行滚动只适用于BorderLayout.CENTER。 bottomBar和bottomBar将可见。

1 个答案:

答案 0 :(得分:2)

禁用Form中的可滚动条。例如,这样做,

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();