/* * createPanels method use splitList method to create n number of panels * using TablePanel class This is the main idea of this class */ public void createPanels(List<List<String>> list) { int a = 1; for (int i = 0; i < list.size(); i++) { Table table = new Table(list.get(i), a); jp.add(table); table.setBounds(0, 50, 527, 370); TablePanel tablePanel = new TablePanel(); tablePanel.addTable(table, true); tablePanel.setName(i + 1 + ""); bottom.add(tablePanel, tablePanel.getName()); a += list.get(i).size(); tablePanel.add(prev); tablePanel.add(next); } if (listSize > 10) { prev.setBounds(5, 20, 70, 23); next.setBounds(460, 20, 70, 23); add(next); add(prev); } }