サンプルコード
import java.awt.* import javax.swing.* import groovy.swing.* sb = new SwingBuilder() sb.edt { frame( title: "example - background color for desktop pane", show: true, resizable: true, size: [300, 300], defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ desktopPane(id:"dp", background: new Color(0xff, 0xff, 0xcc) ){ internalFrame(id: "if1", closable:true, iconifiable:true, maximizable:true, resizable:true, title: "internal frame1", visible:true) { label(text: "internal frame1") }.pack() internalFrame(closable:true, iconifiable:true, maximizable:true, resizable:true, title: "internal frame2", visible:true, size:[200, 100]) { label(text: "internal frame2") } } } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿