コード例 #1
0
  protected BaseDialog createDialog(Component parent, String title) {
    BaseDialog dialog;
    Window window =
        (parent == null ? JOptionPane.getRootFrame() : SwingUtilities.windowForComponent(parent));
    if (window instanceof Frame) {
      dialog = new BaseDialog((Frame) window, title, true);
    } else {
      dialog = new BaseDialog((Dialog) window, title, true);
    }
    dialog.setDialogMode(BaseDialog.OK_CANCEL_DIALOG);
    dialog.getBanner().setVisible(false);

    dialog.getContentPane().setLayout(new BorderLayout());
    dialog.getContentPane().add("Center", this);
    dialog.pack();
    dialog.setLocationRelativeTo(parent);

    return dialog;
  }