使用跷跷板启用全屏?

时间:2012-02-10 00:16:12

标签: swing clojure fullscreen seesaw

按下F11后如何使我的跷跷板程序全屏显示? (不仅仅是最大化)

我目前有这个:

(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会运行但是我无法弄清楚如何使帧全屏。

1 个答案:

答案 0 :(得分:6)

警告说,我没有在跷跷板中试过这个,但我认为这主要是关于直接利用摇摆中可用的东西。

以下建议使用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

我还没有调查过如何获得跷跷板内必要的摆动物体。