2

我有一个表单并添加了四个命令。当用户单击菜单选项时,它会显示可滚动的命令菜单(对话框中的菜单栏)。让命令菜单可滚动对我的应用程序来说不是用户友好的。

如何禁用命令菜单滚动?

4

1 回答 1

0

得到了解决方案......它有点棘手(你需要编辑 LWUIT lib 的 MenuBar.java 源文件)

在 createCommandList 方法中添加以下行

    // Add  your menu list rendered   
    l.setRenderer(new JMenuListRenderer());
    l.setSmoothScrolling(false);
    l.setScrollVisible(false);
    // specify the height you want ( you can make it configurable as well) 
    l.setPreferredH(getCommandCount()*30); 
    l.setPreferredW(Display.getInstance().getDisplayWidth()/2);

并将主题的menuPrefSizeBool设置为 true。

于 2012-12-19T14:19:27.043 回答