public void positionTable(int pos) {
        if (pos != TransactionPanel.TOP && pos != TransactionPanel.BOTTOM)
            throw new IllegalArgumentException("Table position "+pos+" is not valid");

        if (table == null || scrollPane == null || table.getRowCount() == 0)
            return;

        JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
        if (scrollBar == null)
            return;

        if (pos == TransactionPanel.TOP) {
            scrollBar.setValue(0);
        } else {
            scrollBar.setValue(scrollBar.getMaximum());
        }
    }