开发者

Java jmenu on left side

开发者 https://www.devze.com 2023-01-19 12:01 出处:网络
In response to a recent slashdot post, I\'ve decided I wish to add an option for menus to appear on say the left hand side so it doesn\'t obscure the entire application when open. Simply for user conv

In response to a recent slashdot post, I've decided I wish to add an option for menus to appear on say the left hand side so it doesn't obscure the entire application when open. Simply for user convenience, is there any way to f开发者_高级运维orce a jmenu on a jdesktop to be on the left hand side or right hand side, i.e., a vertical menu?


There isn't an easy way to do this.

Your best bet would be to use a BorderLayout and place the JMenuBar in the BorderLayout.WEST or BorderLayout.EAST position. You will have to spend a bit of time customizing it to look good, however. It's not immediately obvious how to get the menu to draw the menu items vertically, for example, or if the menus on the right would fly out the correct direction over the application.

0

精彩评论

暂无评论...
验证码 换一张
取 消