Clojure と Seesaw を使用して GUI アプリを作成し始めました。JFrame といくつかのコンポーネントを作成するだけで、それ以上のことはしません。これがコードです。main 関数は何もせず、start-gui
戻ったらすぐに呼び出して終了します。
(ns pause.gui
(:use seesaw.core))
(native!)
; (javax.swing.UIManager/setLookAndFeel
; "org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel")
(def main-window
(frame :title "Pause"
:on-close :exit))
(def sidebar (listbox :model []))
(def main-area (text :multi-line? true
:font "MONOSPACED-PLAIN-14"
:text "test"))
(def main-split
(left-right-split (scrollable sidebar)
(scrollable main-area)
:divider-location 1/5))
(defn setup-main-window
"Fills the main window with its content"
[main-window]
(config! main-window
:content main-split)
main-window)
(defn start-gui
"Create the main window"
[]
(-> main-window
setup-main-window
pack!
show!))
を使用してこれをコンパイルしlein uberjar
、 で時間を計りましたtime java -jar
。14.5秒と報告されました。私が間違っていることはありますか?3 秒の起動で問題ありませんが、これはまったく受け入れられません。