import javax.swing.* import groovy.swing.* data = [ [category:'Mobile', product:'iPad'], [category:'Mobile', product:'Android'] ] sb = new SwingBuilder() sb.edt { frame( title: "table example", show: true, resizable: true, size: [300, 100], defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ scrollPane(){ table(){ tableModel(list: data){ propertyColumn( header:"category", propertyName: "category") propertyColumn( header:"product", propertyName: "product") } } } } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿