scrollPane.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
  JPanel updateTable()  {    DefaultTableModel mod = (DefaultTableModel) fileTable.getModel();    ListModel lm = fileList.getModel();    DateFormat dt = DateFormat.getDateTimeInstance(DateFormat.SHORT,                                                   DateFormat.SHORT);    File curr = null;    int size = lm.getSize();    int rc = mod.getRowCount();    // If there are not enough rows    for (int x = rc; x < size; x++)      mod.addRow(new Object[3]);    for (int i = 0; i < size; i++)      {        curr = (File) lm.getElementAt(i);        fileTable.setValueAt(curr.getName(), i, 0);        fileTable.setValueAt(formatSize(curr.length()), i, 1);        fileTable.setValueAt(dt.format(new Date(curr.lastModified())), i, 2);      }    // If there are too many rows    while (rc > size)      mod.removeRow(--rc);    scrollPane.setViewport(new JViewport());    scrollPane.getViewport().setView(fileTable);    scrollPane.setColumnHeaderView(fileTable.getTableHeader());    scrollPane.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);    fileTablePanel.removeAll();    fileTablePanel.add(scrollPane);    return fileTablePanel;  }