this.pack(); lblText.addComponentListener(this); lblExceptionText.addComponentListener(this);
    private void initialize(String message, Exception exc) {        final int border = 12;        double[][] dLay = {                { border, TableLayout.PREFERRED, border, 400, border },                { border, TableLayout.PREFERRED, border, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, border, TableLayout.PREFERRED, border }        };                contentPane = new JPanel(new TableLayout(dLay));                boxButtons = Box.createHorizontalBox();        btnOK = new JButton(utils._("OK"));        btnOK.addActionListener(this);        btnDetails = new JButton(utils._("Details") + " >>");        btnDetails.addActionListener(this);                boxButtons.add(Box.createHorizontalGlue());        boxButtons.add(btnOK);        boxButtons.add(Box.createHorizontalStrut(border));        boxButtons.add(btnDetails);        boxButtons.add(Box.createHorizontalGlue());                JLabel lblIcon = new JLabel(UIManager.getIcon("OptionPane.errorIcon"));                lblText = new JLabel("<html>" + message + "</html>");                if (exc.getLocalizedMessage() != null) {            lblExceptionText = new JLabel("<html>" + exc.getLocalizedMessage() + "</html>");        } else            lblExceptionText = null;                strutStacktrace = Box.createVerticalStrut(20);                StringWriter stringBuf = new StringWriter();        exc.printStackTrace(new PrintWriter(stringBuf));                clpDef = new ClipboardPopup();                textStacktrace = new JTextArea(stringBuf.toString());        textStacktrace.setFont(new Font("DialogInput", Font.PLAIN, 12));        textStacktrace.setEditable(false);        textStacktrace.addMouseListener(clpDef);        textStacktrace.setRows(8);        textStacktrace.setColumns(40);                scrollStacktrace = new JScrollPane(textStacktrace, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);                /*        boxLabels = Box.createVerticalBox();        boxLabels.add(lblText);        boxLabels.add(Box.createVerticalStrut(border));        if (lblExceptionText != null) {            boxLabels.add(lblExceptionText);            boxLabels.add(Box.createVerticalStrut(border));        }        boxLabels.add(scrollStacktrace);        boxLabels.add(strutStacktrace);        boxLabels.add(boxButtons);                 contentPane.add(Box.createVerticalStrut(border), BorderLayout.NORTH);        contentPane.add(Box.createVerticalStrut(border), BorderLayout.SOUTH);        contentPane.add(Box.createHorizontalStrut(border), BorderLayout.WEST);        contentPane.add(Box.createHorizontalStrut(border), BorderLayout.EAST);        contentPane.add(boxLabels, BorderLayout.CENTER); */                contentPane.add(lblIcon, "1, 1, 1, 3");        contentPane.add(lblText, "3, 1");        if (lblExceptionText != null)            contentPane.add(lblExceptionText, "3, 3");        contentPane.add(boxButtons, "1, 7, 3, 7");                this.setResizable(false);        this.getRootPane().getRootPane().setDefaultButton(btnOK);        this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);        this.setContentPane(contentPane);        //this.setLocationByPlatform(true);    }