サンプルコード
import java.awt.* import javax.swing.* import groovy.swing.* data = [ [category:'Apache', product:'HTTPD'], [category:'Apache', product:'Tomcat'] ] sb = new SwingBuilder() sb.edt { frame( title: "example - single row selection", show: true, resizable: true, size: [300, 100], defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ scrollPane(){ table(selectionMode:ListSelectionModel.SINGLE_SELECTION){ tableModel(list: data){ propertyColumn( header:"category", propertyName: "category", editable: false ) propertyColumn( header:"product", propertyName: "product", editable: false ) } } } } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿