Action () { return new AbstractAction("&Copy stacktrace") { @Override public void actionPerformed(ActionEvent e) { String text = ExceptionUtil.getThrowableText(myRequests.get(myRequestsTable.getSelectedRow()).trace); CopyPasteManager.getInstance().setContents(new StringSelection(text)); } }; }