示例#1
0
  public SimpleDialog(String title, String description, String helpUrl, boolean okAndCancel) {
    super(UISupport.getMainFrame(), title, true);

    buttons = UISupport.initDialogActions(buildActions(helpUrl, okAndCancel), this);
    buttons.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));

    getContentPane()
        .add(
            UISupport.buildDescription(
                title, description, UISupport.createImageIcon(UISupport.TOOL_ICON_PATH)),
            BorderLayout.NORTH);

    getContentPane().add(buildContent(), BorderLayout.CENTER);

    buttons.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createCompoundBorder(
                BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY),
                BorderFactory.createMatteBorder(1, 0, 0, 0, Color.WHITE)),
            BorderFactory.createEmptyBorder(3, 5, 3, 5)));

    getContentPane().add(buttons, BorderLayout.SOUTH);
    modifyButtons();

    pack();
  }