布局最初看起来不错,但是当窗口重新调整大小时,文本区域的大小没有正确调整。
知道如何解决吗?
谢谢!
import java.awt.BorderLayout
import javax.swing.BorderFactory
import java.awt.GridLayout
import groovy.swing.SwingBuilder
swing = new SwingBuilder()
frame = swing.frame(title:'Test', location:[200,200], size:[300,216]) {
panel(layout: new BorderLayout()){
scrollPane(constraints: BorderLayout.NORTH){
table {
def people = [
['name':'Johan', 'location':'Olso'],
['name':'John', 'location':'London'],
['name':'Jose', 'location':'Madrid'],
['name':'Jos', 'location':'Amsterdam']
]
tableModel( id:'model', list: people) { m ->
propertyColumn(header: 'Name', propertyName: 'name')
propertyColumn(header: 'Location', propertyName: 'location')
}
}
}
}
panel(constraints: BorderLayout.SOUTH){
scrollPane(constraints: BorderLayout.CENTER){
textArea(id:'TextArea', lineWrap:true,wrapStyleWord:true, columns:35, rows:4,editable:true)
}
}
}
frame.show()
最初还可以
重新调整大小后不OK