サンプルコード
import java.awt.* import javax.swing.* import groovy.swing.* sb = new SwingBuilder() sb.edt { frame( title: "example - horizontal alignement", show: true, resizable: true, pack: true, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ label(text:"left", horizontalAlignment: JLabel.LEFT, constraints: BorderLayout.NORTH ) label(text:"center", horizontalAlignment: JLabel.CENTER, constraints: BorderLayout.CENTER ) label(text:"right", horizontalAlignment: JLabel.RIGHT, constraints: BorderLayout.SOUTH ) } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿