void () { myTable.setModelAndUpdateColumns(myTableModel); if (getEmptyPaneText() != null) { final CardLayout cardLayout = ((CardLayout)myInnerPanel.getLayout()); myTable.getModel().addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { cardLayout.show(myInnerPanel, myTable.getRowCount() == 0 ? EMPTY_PANE : TREE); } }); } tuneTable(myTable); }