⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tablelayoutdemo.groovy

📁 大名鼎鼎的java动态脚本语言。已经通过了sun的认证
💻 GROOVY
字号:
package groovy.swingimport java.awt.BorderLayoutimport javax.swing.BorderFactory/** * Demonstrates the use of the table layout */class TableLayoutDemo {        def frame    def swing        void run() {        swing = new SwingBuilder()                frame = swing.frame(title:'TableLayout Demo', location:[200,200], size:[300,200]) {            menuBar {                menu(text:'Help') {                    menuItem() {                        action(name:'About', closure:{ showAbout() })                    }                }            }            tableLayout {                tr {                    td {                        label(text:'name')                    }                    td(colfill:true) {                        textField(text:'James')                    }                }                tr {                    td {                        label(text:'location')                    }                    td(colfill:true) {                        textField(text:'London')                    }                }                tr {                    td(colspan:2, align:'center') {                        button(text:'OK')                    }                }            }        }        frame.show()    }        void showAbout() {         def pane = swing.optionPane(message:'This demo shows how you can use HTML style table layouts with Swing components')         def dialog = pane.createDialog(frame, 'About TableLayout Demo')         dialog.show()    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -