break;
default:
table.setSelection(forward ? 0 : table.getItemCount() - 1);
}
tc.pack();
table.pack();
Rectangle tableBounds = table.getBounds();
tableBounds.height = Math.min(tableBounds.height, table.getItemHeight() * MAX_ITEMS);
table.setBounds(tableBounds);
dialog.pack();