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