Example usage for javax.swing JRootPane ERROR_DIALOG

List of usage examples for javax.swing JRootPane ERROR_DIALOG

Introduction

In this page you can find the example usage for javax.swing JRootPane ERROR_DIALOG.

Prototype

int ERROR_DIALOG

To view the source code for javax.swing JRootPane ERROR_DIALOG.

Click Source Link

Document

Constant used for the windowDecorationStyle property.

Usage

From source file:com.ixora.common.ui.ShowExceptionDialog.java

/**
 * Initializes this dialog./*  w w  w  .  j  a v  a2  s . c  o m*/
 */
private void initialize() {
    this.eventHandler = new EventHandler();
    setSize(smallSize);
    setTitle(MessageRepository.get(Msg.COMMON_UI_TEXT_ERROR));
    if (isDefaultLookAndFeelDecorated()) {
        getRootPane().setWindowDecorationStyle(JRootPane.ERROR_DIALOG);
    }
    textExceptionLong = UIFactoryMgr.createHtmlPane();
    textExceptionLong.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
    textExceptionLong.setEditable(false);
    textExceptionLong.addHyperlinkListener(this.eventHandler);
    textExceptionShort = UIFactoryMgr.createTextField();
    textExceptionShort.setHorizontalAlignment(JTextField.CENTER);
    textExceptionShort.setBorder(null);
    textExceptionShort.setEditable(false);

    panel = new JPanel(new CardLayout());
    JScrollPane s = UIFactoryMgr.createScrollPane();
    s.setBorder(null);
    s.setViewportView(textExceptionLong);
    panel.add(s, "long");
    panel.add(textExceptionShort, "short");

    // set background color to the color of the panel
    textExceptionShort.setBackground(panel.getBackground());
    textExceptionLong.setBackground(panel.getBackground());

    buildContentPane();
}