java - How to make GridBagLayout more logical -
i have following code below:
c.fill = gridbagconstraints.horizontal; c.gridx = 1; c.gridy = 0; config.add(first = new jtextarea(), c); c.gridx = 1; c.gridy = 2; config.add(second = new jtextarea(), c); c.gridx = 1; c.gridy = 10; c.anchor = gridbagconstraints.page_end; config.add(bottom, c);
and following screenshot:
"bottom" button panel. starters, 2 text fields merged together, , buttons should on bottom. looking @ oracle instructions on gridbaglayout didn't much. ideas?
assuming class extends jpanel calling super(new gridbaglayout()) @ first line of constructor may solve issue...
try adding line c.width=gridbagconstaints.remainder;
Comments
Post a Comment