/** * Adds a new cell to this row * * @param tag the td element */ public void addCell(groovy.swing.impl.TableLayoutCell tag) { int gridx = 0; for (Iterator iter = cells.iterator(); iter.hasNext(); ) { groovy.swing.impl.TableLayoutCell cell = (groovy.swing.impl.TableLayoutCell) iter.next(); gridx += cell.getColspan(); } tag.getConstraints().gridx = gridx; cells.add(tag); }
public void addComponentsForRow() { rowIndex = parent.nextRowIndex(); // iterate through the rows and add each one to the layout... for (Iterator iter = cells.iterator(); iter.hasNext(); ) { groovy.swing.impl.TableLayoutCell cell = (groovy.swing.impl.TableLayoutCell) iter.next(); GridBagConstraints c = cell.getConstraints(); c.gridy = rowIndex; // add the cell to the table parent.addCell(cell); } }