Pergunta

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 force a jmenu on a jdesktop to be on the left hand side or right hand side, i.e., a vertical menu?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top