Dialogについて

ここの例のようにCUIからDialogを使うことはあまりありません。CUIならコマンドライン引数やinputを使いますが、プログラムがわかりにくい上に出来上がるインターフェースも直感的でないので、あえてこれを使います。

showInputDialogメソッド()

static String 	showInputDialog(Component parentComponent, Object message)
static String 	showInputDialog(Component parentComponent, Object message, Object initialSelectionValue)
static String 	showInputDialog(Component parentComponent, Object message, String title, int messageType)
static Object 	showInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
static String 	showInputDialog(Object message)
static String 	showInputDialog(Object message, Object initialSelectionValue)

showInternalInputDialog()は必ず親が必要。親のフレームからはみ出さないダイアログ。

static String 	showInternalInputDialog(Component parentComponent, Object message)
static String 	showInternalInputDialog(Component parentComponent, Object message, String title, int messageType)
static Object 	showInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue) 

showMessageDialog()メソッド

static void 	showMessageDialog(Component parentComponent, Object message)
          「Message」というタイトルの情報メッセージダイアログを表示します。
static void 	showMessageDialog(Component parentComponent, Object message, String title, int messageType)
          messageType パラメータで指示されたデフォルトのアイコンを使用して、メッセージを表示するためのダイアログを表示します。
static void 	showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
          すべてのパラメータを指定して、メッセージを表示するためのダイアログを表示します。
static int 	showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
          指定されたアイコンを持つダイアログを表示します。

showInternalMessageDialog()は必ず親が必要。親のフレームからはみ出さないダイアログ。

static void 	showInternalMessageDialog(Component parentComponent, Object message)
          内部確認ダイアログパネルを表示します。
static void 	showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType)
          messageType パラメータで指定されたデフォルトアイコンを使用して、メッセージを表示するための内部ダイアログパネルを表示します。
static void 	showInternalMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
          すべてのパラメータを指定して、メッセージを表示するための内部ダイアログパネルを表示します。
static int 	showInternalOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue) 
           指定されたアイコンを持つ内部ダイアログパネルを表示します。

messageType

メッセージのスタイルを定義します。Look & Feel マネージャーは、この値に応じてダイアログを個別に配置し、通常はデフォルトのアイコンを用意します。返される値は次のどれかになります。

        ERROR_MESSAGE
        INFORMATION_MESSAGE
        WARNING_MESSAGE
        QUESTION_MESSAGE
        PLAIN_MESSAGE 

optionType

ダイアログボックスの下部に表示されるオプションボタンのセットを定義します。

        DEFAULT_OPTION
        YES_NO_OPTION
        YES_NO_CANCEL_OPTION
        OK_CANCEL_OPTION