private final void arrangeRows() { Y = 0; int rowTotal = hsmRow.size(); if (rowTotal < 1) return; for (int i = 1; i <= rowTotal; i++) { int W = 0; int X = tblHeader.getX() + 2; for (int j = 0; j < columnTotal; j++) { W = table.getColumnModel().getColumn(j).getWidth(); arrangeCellsInRow(hsmRow.get(i)[j], X, Y, W, H); X += W; } Y += H; } }
private final void addCellsToContainer(JComponent[] cells) { int W = 0; int X = tblHeader.getX() + 2; if (cells.length != columnTotal) { System.err.println("ERROR : Cell Component total not match with Column total"); return; } int cellTotal = cells.length; for (int i = 0; i < cellTotal; i++) { pnlRows.add(cells[i]); if (cells[i] instanceof JLabel) { cells[i].setBorder(BorderFactory.createEtchedBorder()); ((JLabel) cells[i]).setHorizontalAlignment(SwingConstants.CENTER); if (i == 0) cells[i].setFont(new Font("Tahoma", 0, 24)); } W = table.getColumnModel().getColumn(i).getWidth(); arrangeCellsInRow(cells[i], X, Y, W, H); X += W; } Y += H; }