我想添加一个滚动窗格,其中包含一个文本区域,但我不知道如何。所以我在互联网上搜索并找到了一些例子,但没有一个对我有帮助。
这是我的一些代码:
frame = sb.frame(title:"BPNM Builder", size:[600, 400],defaultCloseOperation:WindowConstants.EXIT_ON_CLOSE){
panel(id:'mainpanel',border:BorderFactory.createEmptyBorder(10,10,10,10)){
gridBagLayout()
label(
text:"out:",
constraints: gbc(gridx:0,gridy:0,fill:HORIZONTAL,insets:[0, 0, 323, 0])
)
textArea(
id:'liste',"commands:\n" + ml.opList,preferredSize:new Dimension(200,180),
constraints:gbc(gridx:1,gridy:0,gridwidth:REMAINDER,fill:VERTICAL,insets:[20, 300, 85, 0])
,editable:false
)
textArea(
id:'outline',preferredSize:new Dimension(350,140),
constraints:gbc(gridx:0,gridy:0,gridwidth:REMAINDER,fill:VERTICAL,insets:[20, 0, 85, 200])
,editable:false, lineWrap:true, wrapStyleWord:true
)
有人可以告诉我,如何在我的框架中添加一个包含文本区域的滚动窗格?
提前致谢!