サンプルコード
import java.awt.* import javax.swing.* import groovy.swing.* sb = new SwingBuilder() sb.edt { frame( title: "example : gap between label and icon", show: true, resizable: true, pack: true, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ label(text:"example label1", icon:imageIcon(file:"e:/icons/home.png"), iconTextGap:10, constraints: BorderLayout.NORTH ) label(text:"example label2", icon:imageIcon(file:"e:/icons/plane.png"), iconTextGap:20, constraints: BorderLayout.CENTER ) label(text:"example label3", icon:imageIcon(file:"e:/icons/mobile2.png"), iconTextGap:30, constraints: BorderLayout.SOUTH ) } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿