Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Groovy Swingbuilder:如何将滚动面板添加到框架中?_Groovy_Textarea_Scrollpane_Swingbuilder - Fatal编程技术网

Groovy Swingbuilder:如何将滚动面板添加到框架中?

Groovy Swingbuilder:如何将滚动面板添加到框架中?,groovy,textarea,scrollpane,swingbuilder,Groovy,Textarea,Scrollpane,Swingbuilder,我想添加一个滚动窗格,其中包含一个文本区域,但我不知道如何添加。所以我在网上搜索了一些例子,但没有一个对我有帮助。 这是我的一些代码: frame = sb.frame(title:"BPNM Builder", size:[600, 400],defaultCloseOperation:WindowConstants.EXIT_ON_CLOSE){ panel(id:'mainpanel',border:BorderFactory.createEmptyBorder(10,10,10,10)

我想添加一个滚动窗格,其中包含一个文本区域,但我不知道如何添加。所以我在网上搜索了一些例子,但没有一个对我有帮助。 这是我的一些代码:

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
            )
有人能告诉我,我如何能添加一个滚动窗格到我的框架,包含文本区域

提前谢谢

只需在滚动窗格中嵌入文本区域:


不是一个优秀的程序员!但是,为滚动窗格调用setViewportView并传递文本区域。这可能是viewportView。
scrollPane(constraints:gbc(gridx:1, gridy:0, gridwidth:REMAINDER, fill:VERTICAL, insets:[20, 300, 85, 0])) {
    textArea(id:'liste', "commands:\n" + ml.opList,editable:false)
}