Hi, I'm trying to make some components inside a JSrollPane unresizable, because content inside can grow dynamically and I must prevent it from growing over a predefined size.
My approach so far is this one:
scrollPane(constraints:BL.CENTER, size:[500,200], maximumSize:[500,200]){
panel(background:Color.WHITE, border:BF.createTitledBorder('Results')) {
gridBagLayout()
f0 = label(constraints:gbc(gridx:0, gridy:0))
fk = label(constraints:gbc(gridx:0, gridy:1))
}
}
(this is Groovy but objects are the same as Swing (eg label = JLabel, panel = JPanel..)
And it works but when inserting into the label a text that is long for example 2000px the first call to repaint in the frame that contains this scrollpane makes the whole scrollpane resize (until the scrollbar actually disappears).
I need to force to remain to the size I want!
Am I missing something? Or is it a bug of groovy? (it seems strange because this should just maps calls to normal swing components)