private UncaughtExceptionDialog(Dialog.ModalityType modalityType, String s, UncaughtExceptionParameters params) {
        setResizable(false);
        setTitle(params.getTitle());
        setIconImage(params.getDialogIconImage());
        setModalityType(modalityType);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        final JTextArea ta = new JTextArea(s);
        ta.setOpaque(false);
        gbc.gridx = 1;
        gbc.gridy = 2;
        gbc.insets = new Insets(5, 10, 10, 10);
        gbc.anchor = GridBagConstraints.CENTER;
        final JScrollPane sp = new JScrollPane(ta);
        ta.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        add(sp, gbc);
        final JToggleButton btDetails = new JToggleButton("« " + params.getDetails());
        btDetails.setOpaque(false);
        btDetails.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                setDetailsVisible(sp, btDetails.isSelected());
            }
            
        });
        JButton btOk = new JButton(params.getOk());
        btOk.setOpaque(false);
        btOk.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
            
        });
        gbc.gridy = 1;
        gbc.insets = new Insets(0, 10, 5, 10);
        JPanel p = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        p.setOpaque(false);
        p.add(btDetails);
        p.add(btOk);
        add(p, gbc);
        JPanel pi = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
        JLabel li = createMessageIconLabel(params.getMessageIconImage());
        if (li != null) {
            li.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
            pi.add(li);
        }
        final JLabel lb = new JLabel(params.getInfo());
        lb.setOpaque(false);
        MouseAdapter lbma = params.getMessageListener();
        if (lbma != null) {
            lb.addMouseListener(lbma);
            lb.addMouseMotionListener(lbma);
            lb.addMouseWheelListener(lbma);
        }
        JPanel pci = new JPanel(new GridBagLayout());
        pci.setOpaque(false);
        GridBagConstraints pcc = new GridBagConstraints();
        pcc.anchor = GridBagConstraints.LINE_START;
        pci.add(lb, pcc);
        pi.add(pci);
        setComponent(params.getComponent());
        pcc.gridy = 1;
        pcc.fill = GridBagConstraints.BOTH;
        pcc.insets = new Insets(5, 0, 0, 0);
        pci.add(pc, pcc);
        gbc.gridy = 0;
        gbc.insets = new Insets(10, 10, 0, 10);
        add(pi, gbc);
        Dimension d = new Dimension(400, 150);
        sp.setMinimumSize(d);
        sp.setPreferredSize(d);
        pack();
        btOk.setPreferredSize(btDetails.getSize());
        int w = sp.getSize().width;
        p.setPreferredSize(new Dimension(w, p.getSize().height));
        pi.setPreferredSize(new Dimension(w, pi.getSize().height));
        setLocationRelativeTo(this);
        ta.setPreferredSize(ta.getSize());
        ta.setEditable(false);
        setDetailsVisible(sp, false);
        final JPopupMenu pm = new JPopupMenu();
        final JMenuItem mic = new JMenuItem(params.getCopy());
        final JMenuItem misa = new JMenuItem(params.getSelectAll());
        ActionListener al = new ActionListener() {
            
            @Override
            public void actionPerformed(ActionEvent e) {
                if (e.getSource() == mic) {
                    ta.copy();
                }
                else if (e.getSource() == misa) {
                    ta.requestFocus();
                    ta.selectAll();
                }
            }
            
        };
        mic.addActionListener(al);
        pm.add(mic);
        misa.addActionListener(al);
        pm.add(misa);
        ta.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                JTextComponent tc = (JTextComponent) e.getSource();
                if (tc.isEnabled()) {
                    if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() >= 2) {
                        tc.selectAll();
                    }
                    else if (e.getButton() == MouseEvent.BUTTON3) {
                        mic.setEnabled(tc.getSelectedText() != null);
                        pm.show(tc, e.getX(), e.getY());
                    }
                }
            }
            
        });
        btOk.requestFocus();
    }