---
title: JOptionPane
tags: [JOptionPane]
description: JOptionPane関係の記事へのスクリーンショット付きリンク一覧
---
このページでは、`JOptionPane`のカスタマイズ、使用方法などを集めて一覧にしています。

#contents

* JOptionPane [#JOptionPane]
** JOptionPaneを自動的に閉じる [#AutomaticallyCloseDialog]
#swingdescription(Swing/AutomaticallyCloseDialog,JOptionPaneを自動的に閉じる,JOptionPaneにカウントダウンと自動クローズを行うためのJLabelを追加します。,https://lh6.googleusercontent.com/-NvrpIdRXy8M/UiMOJmS8OMI/AAAAAAAABzg/6QK49B0s-NE/s200/AutomaticallyCloseDialog.png)

** JOptionPaneで使用するボタンのサイズを揃える [#SameSizeButtons]
#swingdescription(Swing/SameSizeButtons,JOptionPaneで使用するボタンのサイズを揃える,NimbusLookAndFeelでJOptionPaneを使用した場合、そのJButtonのサイズを揃えるかどうかを設定します。,https://lh3.googleusercontent.com/-vidT_rr0mcE/VU97kF6HGpI/AAAAAAAAN4A/ByrWGh41AQg/s200/SameSizeButtons.png)

** JWindowをデスクトップにスライドインで表示する [#SlideInNotificationWindow]
#swingdescription(Swing/SlideInNotificationWindow,JWindowをデスクトップにスライドインで表示する,JOptionPaneを追加したJWindowを、スライドインアニメーションを使ってデスクトップ上に表示します。,https://lh4.googleusercontent.com/-axruZWDGZys/U98iB0eZi8I/AAAAAAAACK0/hh_jWt5nsi4/s200/SlideInNotificationWindow.png)

** JOptionPaneのデフォルトフォーカス [#OptionPaneDefaultFocus]
#swingdescription(Swing/OptionPaneDefaultFocus,JOptionPaneのデフォルトフォーカス,JOptionPaneにデフォルトでフォーカスをもつコンポーネントを追加します。,https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTQoUaDrDI/AAAAAAAAAf4/nUnrCrmb5io/s200/OptionPaneDefaultFocus.png)

** JOptionPaneに配置するJTextAreaの最大幅を指定してサイズ調整を行う [#MaxWidthWrapOptionPane]
#swingdescription(Swing/MaxWidthWrapOptionPane,JOptionPaneに配置するJTextAreaの最大幅を指定してサイズ調整を行う,JOptionPaneに配置するJTextAreaの最大幅を指定し、テキストが複数行になってもその幅を超えず、スクロールバーも表示されない高さまで拡張されるよう設定します。,https://lh3.googleusercontent.com/-wvgqUKEkJe8/VwE0eREDhVI/AAAAAAAAOSM/aEgf3UtLBX0g-u9CKBFg_8nCbt7-0CLngCCo/s200-Ic42/MaxWidthWrapOptionPane.png)

** JOptionPaneのボタンの揃えを変更する [#OptionPaneButtonOrientation]
#swingdescription(Swing/OptionPaneButtonOrientation,JOptionPaneのボタンの揃えを変更する,JOptionPaneの下部に表示されるオプションボタンの揃えを右揃えなどに変更します。,https://drive.google.com/thumbnail?id=1GfIGoZXfe9MpKMUVblmQ68ek4z5tU-4cPw)

** JOptionPaneのYesボタンがCancelボタンなどの中で末尾に配置されるよう設定する [#YesLastOptionPane]
#swingdescription(Swing/YesLastOptionPane,JOptionPaneのYesボタンがCancelボタンなどの中で末尾に配置されるよう設定する,JOptionPaneのYesボタンがCancelボタンなどの後に追加されて一番右に配置されるよう設定します。,https://drive.google.com/thumbnail?id=12DSo9IIp_Ah9F2FlvkEjjREEwZXyNNLWhA)

** JOptionPaneのOKボタンを文字列が入力されるまで選択不可に設定する [#DisabledOkButtonOptionPane]
#swingdescription(Swing/DisabledOkButtonOptionPane,JOptionPaneのOKボタンを文字列が入力されるまで選択不可に設定する,JOptionPaneのConfirmDialogに表示されるOKボタンを文字列が入力されるまで選択不可に設定します。,https://drive.google.com/thumbnail?id=1blPT1pPi2dsuRd88JceWb8mITDHT9Yd1)

** JOptionPaneの背景色を変更する [#OptionPaneBackground]
#swingdescription(Swing/OptionPaneBackground,JOptionPaneの背景色を変更する,JOptionPaneで使用されている子JPanelをすべて透明化して背景色を指定した色に変更します。,https://drive.google.com/thumbnail?id=1jUaaox2WyFYAqVow6MbfH7o9rGY-7WqC)

** JOptionPaneで使用するメッセージダイアログのOKボタンテキストを変更する [#OptionPaneOkButtonText]
#swingdescription(Swing/OptionPaneOkButtonText,JOptionPaneで使用するメッセージダイアログのOKボタンテキストを変更する,JOptionPaneから作成、使用可能なメッセージダイアログのOKボタンテキストを変更します。,https://drive.google.com/thumbnail?id=1ngT9-9mnVJgjE-wARclMMawkfYmQ0G86)

* ↑10 ↓11 [#hc0fc727]
#adsensebar

** JOptionPaneのタイトルバー背景色をMessageTypeに応じて変更する [#OptionPaneMessageTypeColor]
#swingdescription(Swing/OptionPaneMessageTypeColor,JOptionPaneのタイトルバー背景色をMessageTypeに応じて変更する,JOptionPaneのタイトルバー背景色や縁色などをMessageTypeに対応した色に変更します。,https://drive.google.com/thumbnail?id=1AVd6cPRb_L98qWsiVXcNaQ8LYNvJB9T_)

** JOptionPaneの最小サイズを設定する [#OptionPaneMinimumSize]
#swingdescription(Swing/OptionPaneMinimumSize,JOptionPaneの最小サイズを設定する,JOptionPaneの最小サイズをUIManagerを使用して変更します。,https://drive.google.com/thumbnail?id=1VDOBP5adm7znzjkXMCd2ew2SKGJGgQW_)

** JOptionPaneのメッセージエリアとボタンエリアの間の内余白を変更する [#OptionPaneSeparatorPadding]
#swingdescription(Swing/OptionPaneSeparatorPadding,JOptionPaneのメッセージエリアとボタンエリアの間の内余白を変更する,NimbusLookAndFeelのJOptionPaneでそのメッセージエリアとボタンエリアの間の内余白や全体の外余白を変更します。,https://drive.google.com/thumbnail?id=1EIQNyh8JYazie0dhndQG2Qc-oZyfFzZH)