public TablePopupMenuMouseListener() {
        Action action = new AbstractAction(I18N.getLabelString("Copy Selected")) {
            public void actionPerformed(ActionEvent ae) {
                StringBuffer sbf = new StringBuffer();
                // Check to ensure we have selected only a contiguous block of
                // cells
                int numcols = table.getSelectedColumnCount();
                int numrows = table.getSelectedRowCount();
                int[] rowsselected = table.getSelectedRows();
                int[] colsselected = table.getSelectedColumns();
                if (!((numrows - 1 ==
                       rowsselected[rowsselected.length - 1] - rowsselected[0] &&
                       numrows == rowsselected.length) &&
                      (numcols - 1 ==
                       colsselected[colsselected.length - 1] - colsselected[0] &&
                       numcols == colsselected.length))) {
                    JOptionPane.showMessageDialog(null,
                                                  I18N.getMessageString("Invalid copy selection."),
                                                  I18N.getLabelString("Error"),
                                                  JOptionPane.ERROR_MESSAGE);
                    return;
                }
                for (int i = 0; i < numrows; i++) {
                    for (int j = 0; j < numcols; j++) {
                        sbf.append(table.getValueAt(rowsselected[i],
                                colsselected[j]));
                        if (j < numcols - 1) {
                            sbf.append("\t");
                        }
                    }
                    sbf.append("\n");
                }
                StringSelection stsel = new StringSelection(sbf.toString());
                Clipboard system = Toolkit.getDefaultToolkit().
                                   getSystemClipboard();
                system.setContents(stsel, stsel);
            }
        };
        copyItem = popup.add(action);
        //copyItem.setMnemonic('c');

        action = new AbstractAction(I18N.getLabelString("Select All")) {
            public void actionPerformed(ActionEvent ae) {
                table.changeSelection(0, 0, false, false);
                for (int i = 0; i < table.getRowCount(); i++) {
                    for (int j = 0; j < table.getColumnCount(); j++) {
                        table.changeSelection(i, j, false, true);
                    }
                }
                table.revalidate();
                table.repaint();
            }
        };
        selectAllItem = popup.add(action);
        //selectAllItem.setMnemonic('a');

        action = new AbstractAction(I18N.getLabelString("Clear Selection")) {
            public void actionPerformed(ActionEvent ae) {
                table.clearSelection();
                table.revalidate();
                table.repaint();
            }
        };
        clearItem = popup.add(action);
        //clearItem.setMnemonic('c');
    }