开发者

Is there a Java/Swing implementation of "compound menu item" as in Chrome?

开发者 https://www.devze.com 2023-03-01 02:08 出处:网络
First of all, is there an开发者_如何学编程 \"official\" name for menu items like Edit and Zoom in the Chrome browser?

First of all, is there an开发者_如何学编程 "official" name for menu items like Edit and Zoom in the Chrome browser?

Is there a Java/Swing implementation of "compound menu item" as in Chrome?

Is there an existing Swing implementation?

On the surface it could be another "I can do it in a weekend" thing, but getting the button to look good for all LAFs would be difficult as always, since the default button is obviuosly too "boxy" for these "inline" buttons (and the "spinner lite" for Zoom). And getting text/accelerator alignment correct could be next to impossible.


I think you might be missing the point of a LAF. If a look and feel contains boxy buttons then you should let it define the borders and look of the button. The only way you can let something work for all look and feels is not to mess with the defaults.

However, if you want something to look a specific way, you will need to create a custom component, that possibly uses defaults colors for a menu or button, or preset values.


There is a partial Swing implementation here:

http://code.google.com/p/jbuttonmenuitem/

It can handle the Edit menu items, but probably not the Zoom.

0

精彩评论

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