void (ListSelectionEvent e) { if (myLog.getSelectedIndex() == -1) { myAllocation.setText(null); } else { FocusElement element = myLog.getSelectedValue(); final StringWriter s = new StringWriter(); final PrintWriter writer = new PrintWriter(s); element.getAllocation().printStackTrace(writer); @NlsSafe String trace = s.toString(); myAllocation.setText(trace); } }