<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 桌面應用 Clojure 可以創建基于Swing的GUI程序。下面是一個簡單的例子, 用戶可以輸入他們的名字,然后點擊“Greet:按鈕,然后它會彈出一個對話框顯示一個歡迎信息。可以關注一下這里我們使用了 `proxy` 宏來創建一個集成某個指定類 ( `JFrame` )并且實現了一些java接口 (這里只有 `ActionListener` 一個接口)的對象。. ![Swing input frame](https://box.kancloud.cn/2016-05-04_5729b1373ce0e.png) ![Swing output dialog](https://box.kancloud.cn/2016-05-04_5729b13754b11.png) ``` (ns com.ociweb.swing (:import (java.awt BorderLayout) (java.awt.event ActionListener) (javax.swing JButton JFrame JLabel JOptionPane JPanel JTextField))) (defn message "gets the message to display based on the current text in text-field" 1 (str "Hello, " (.getText text-field) "!")) ; Set the initial text in name-field to "World" ; and its visible width to 10. (let [name-field (JTextField. "World" 10) greet-button (JButton. "Greet") panel (JPanel.) frame (proxy [JFrame ActionListener] [] ; superclass constructor arguments (actionPerformed [e] ; nil below is the parent component (JOptionPane/showMessageDialog nil (message name-field))))] (doto panel (.add (JLabel. "Name:")) (.add name-field)) (doto frame (.add panel BorderLayout/CENTER) (.add greet-button BorderLayout/SOUTH) (.pack) (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE) (.setVisible true)) ; Register frame to listen for greet-button presses. (.addActionListener greet-button frame)) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看