import java.awt.* import javax.swing.* import groovy.swing.* sb = new SwingBuilder() sb.edt { frame( title: "password field example", show: true, resizable: true, pack: true, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ passwordField(id:"pf1", text:"password", constraints: BorderLayout.NORTH ) button(text:"OK", constraints: BorderLayout.SOUTH, actionPerformed: { sb.optionPane( message:"textfield1=${sb.pf1.text}", messageType:JOptionPane.INFORMATION_MESSAGE) .createDialog("passwordfield").visible = true } ) } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿