使用跷跷板启用全屏?
当按下 F11 时,如何使我的 seesaw 程序全屏显示? (不仅仅是最大化)
我目前有这样的:
(defn toggle-full-screen [e]
(-> (to-root e)
magic!)
(def full-screen-action (action :name "Full Screen" :tip "Full Screen"
:mnemonic \f :key (keystroke "F11")
:handler toggle-full-screen))
(def view-menu (menu :text "View"
:mnemonic \v
:items [full-screen-action]))
(def top-menubar (menubar :items [view-menu]))
[...]
按下 F11 时 toggle-full-screen
运行,但是我不知道如何使框架全屏显示。
How can I make my seesaw program full screen when F11 is pressed? (not just maximized)
I currently have this:
(defn toggle-full-screen [e]
(-> (to-root e)
magic!)
(def full-screen-action (action :name "Full Screen" :tip "Full Screen"
:mnemonic \f :key (keystroke "F11")
:handler toggle-full-screen))
(def view-menu (menu :text "View"
:mnemonic \v
:items [full-screen-action]))
(def top-menubar (menubar :items [view-menu]))
[...]
toggle-full-screen
runs when F11 is pressed however I can't figure out how to make the frame fullscreen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
警告脚本者,我还没有在跷跷板中尝试过这个,但我认为这主要是直接利用 Swing 中可用的东西。
下面建议了可以使用 swing API 执行哪些操作:
http://weblogs.java.net/blog /mkarg/archive/2010/01/03/fullscreen-mode-cool
另外:
http://docs.oracle.com/javase/tutorial/extra/fullscreen /index.html
至少部分技巧是在框架上调用
setUndecorated
。我还没有研究如何在跷跷板上获得必要的摆动物体。
Caveat scriptor, I haven't tried this in seesaw but I think this is mostly about directly leveraging what is available in swing.
The following suggests what can be done with the swing API:
http://weblogs.java.net/blog/mkarg/archive/2010/01/03/fullscreen-mode-cool
Also:
http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html
At least part of the trick is to call
setUndecorated
on the frame.I haven't investigated how you get at the necessary swing objects within seesaw yet.