サンプルコード
import java.awt.* import javax.swing.* import groovy.swing.* sb = new SwingBuilder() sb.edt { frame( title: "non editable textfied/textarea example", show: true, resizable: true, pack: true, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ textField(id:"tf1", editable:false, text:"example textfield1", constraints: BorderLayout.NORTH ) scrollPane(constraints: BorderLayout.CENTER){ textArea(id:"ta1", editable:false, opaque:false, background: UIManager.getColor("TextField.background"), text:"""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.""" ) } } }実行時画面
動作環境
groovy 2.2.2, JDK 1.7 update55
0 件のコメント:
コメントを投稿