Noob question: I have the following Forms layout (please excuse the JRuby syntax). I'd like all three buttons to have their heights stretched to fill the available space. but only button 3 does so.
require 'java'
require './lib/jgoodies-common-1.2.1.jar'
require './lib/jgoodies-forms-1.4.2.jar'
java_import javax.swing.JButton
java_import javax.swing.JFrame
java_import com.jgoodies.forms.layout.CellConstraints
java_import com.jgoodies.forms.layout.FormLayout
class Foo < JFrame
def initialize
super
cc = CellConstraints.new
layout = FormLayout.new(
"10dlu, pref:grow, 10dlu, pref:grow, 10dlu",
"10dlu, pref:grow, 10dlu, pref:grow, 10dlu"
)
layout.setRowGroups([[2, 4]])
layout.setColumnGroups([[2, 4]])
self.setLayout(layout)
self.add(JButton.new("button 1"), cc.xy(2, 2))
self.add(JButton.new("button 2"), cc.xy(2, 4))
self.add(JButton.new("button 3"), cc.xywh(4, 2, 1, 3))
self.pack
self.setVisible(true)
self.toFront
end
end
Foo.new
Tips and pointers appreciated.
--Ben