jmenu的简单问题

newman0708 2002-05-19 10:11:19
JMenu filemenu=new JMenu("file",true);不知这个boolen量有什么用?

“Constructs a new JMenu with the supplied string as its text and specified as a tear-off menu or not.”
是什么意思?
...全文
46 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
soldier1002 2002-05-19
  • 打赏
  • 举报
回复
if boolean is true, then the menu content in the menu can be cut away from the menu list.

However, this method is not implemented yet, so setting of this boolean value will not have any effect
FooSleeper 2002-05-19
  • 打赏
  • 举报
回复
摘自java doc, JMenu
Parameters:
s - the text for the menu label
b - can the menu be torn off (not yet implemented)
~~~~~~~~~~~~~~~~~~~~
恐怕要j2sdk1.4.1中才有用吧
FooSleeper 2002-05-19
  • 打赏
  • 举报
回复
好像没见过这样的
也许Solaris上面用?
FooSleeper 2002-05-19
  • 打赏
  • 举报
回复
A menu can optionally be a tear-off menu. A tear-off menu can be opened and dragged away from its parent menu bar or menu. It remains on the screen after the mouse button has been released. The mechanism for tearing off a menu is platform dependent, since the look and feel of the tear-off menu is determined by its peer. On platforms that do not support tear-off menus, the tear-off property is ignored.

--引自java.awt.Menu
newman0708 2002-05-19
  • 打赏
  • 举报
回复
谢谢各位参加讨论。

tear-off menu 具体是指什么?(就像哪种菜单?)

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧