JPanel messagePanel = new JPanel(new BorderLayout());
JLabel label = new JLabel(message);
messagePanel.add(label);
if (ex != null) {
JComponent panel = new JXPanel(new BorderLayout());
panel.setBorder(new RoundedBorder());
// remind(aim): provide way to allow user to see exception only if desired
StringWriter writer = new StringWriter();
ex.printStackTrace(new PrintWriter(writer));
JTextArea exceptionText = new JTextArea();
exceptionText.setText("Cause of error:\n" +
writer.getBuffer().toString());
exceptionText.setBorder(new RoundedBorder());
exceptionText.setOpaque(false);
exceptionText.setBackground(
Utilities.deriveColorHSB(UIManager.getColor("Panel.background"),
0, 0, -.2f));
JScrollPane scrollpane = new JScrollPane(exceptionText);