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

- `JOptionPane`は[[JOptionPane>Swing/_JOptionPane]]に移動
- `JColorChooser`は[[JColorChooser>Swing/_JColorChooser]]に移動

#contents

* JFileChooser [#JFileChooser]
** JFileChooserを開いたままファイルの上書き警告ダイアログを表示する [#FileAlreadyExistsDialog]
#swingdescription(Swing/FileAlreadyExistsDialog,JFileChooserを開いたままファイルの上書き警告ダイアログを表示する,JFileChooserで名前を付けて保存する場合、すでに存在するファイルを選択してセーブボタンを押すと上書き警告ダイアログを表示するように設定します。,https://lh6.googleusercontent.com/-77H8Wl7UgV0/T_E-hZznv2I/AAAAAAAABOo/RIVqWmchCfw/s200/FileAlreadyExistsDialog.png)

** JFileChooserに画像プレビューを追加 [#PreviewAccessory]
#swingdescription(Swing/PreviewAccessory,JFileChooserに画像プレビューを追加,JFileChooserに選択した画像ファイルのプレビューを表示する機能を追加します。,https://lh4.googleusercontent.com/_9Z4BYR88imo/TQTRN6_UpeI/AAAAAAAAAg0/eJZas5kcb34/s200/PreviewAccessory.png)

** JFileChooserのリサイズなどを制限 [#FixedSizeFileChooser]
#swingdescription(Swing/FixedSizeFileChooser,JFileChooserのリサイズなどを制限,JFileChooserのリサイズや、最小サイズ以下へのサイズ変更を禁止します。,https://lh6.googleusercontent.com/_9Z4BYR88imo/TQTM16q-C_I/AAAAAAAAAZ0/i21vjp9vPjc/s200/FixedSizeFileChooser.png)

** JFileChooserを編集不可にする [#ROFileChooser]
#swingdescription(Swing/ROFileChooser,JFileChooserを編集不可にする,JFileChooser内でのファイル名変更や新規フォルダ作成などの編集を不可にします。,https://lh4.googleusercontent.com/_9Z4BYR88imo/TQTR_zuU1UI/AAAAAAAAAiE/nZgj97xKO24/s200/ROFileChooser.png)

** JFileChooserにファイルフィルタを追加 [#FileFilter]
#swingdescription(Swing/FileFilter,JFileChooserにフィルタを追加,JFileChooserにファイルフィルタを追加し、指定したファイルのみ表示します。,https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTMc7NJ5UI/AAAAAAAAAZM/p-hliI-ZnLs/s200/FileFilter.png)

** JFileChooserにLocaleを設定する [#Locale]
#swingdescription(Swing/Locale,JFileChooserにLocaleを設定する,JFileChooserにLocaleを設定して、タイトルやボタンの文字列を変更します。,https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTPdRLH4_I/AAAAAAAAAeA/tZciS7a5CCc/s200/Locale.png)

** JFileChooserのボタンテキストを変更 [#ApproveButtonText]
#swingdescription(Swing/ApproveButtonText,JFileChooserのボタンテキストを変更,JFileChooserのボタンテキストを変更します。,https://lh4.googleusercontent.com/_9Z4BYR88imo/TQTHw6_sLrI/AAAAAAAAARs/5fsN5G2p15U/s200/ApproveButtonText.png)

** JFileChooserのPlacesBarを非表示にする [#NoPlacesBarFileChooser]
#swingdescription(Swing/NoPlacesBarFileChooser,JFileChooserのPlacesBarを非表示にする,JFileChooser(WindowsLookAndFeel)のPlacesBarを非表示にします。,https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTQZdQnWAI/AAAAAAAAAfg/Cne_bKrk8BU/s200/NoPlacesBarFileChooser.png)

** JFileChooserのデフォルトをDetails Viewに設定 [#DetailsViewFileChooser]
#swingdescription(Swing/DetailsViewFileChooser,JFileChooserのデフォルトをDetails Viewに設定,JFileChooserを開いたときのデフォルトをリストではなく詳細に変更します。,https://lh3.googleusercontent.com/_9Z4BYR88imo/TSq77M-soeI/AAAAAAAAAxg/0nnen-n-cAY/s200/DetailsViewFileChooser.png)

** JFileChooserで読み取り専用ファイルのリネームを禁止 [#RenameIfCanWriteFileChooser]
#swingdescription(Swing/RenameIfCanWriteFileChooser,JFileChooserで読み取り専用ファイルのリネームを禁止,JFileChooserで読み取り専用属性ファイルのリネームを禁止します。,https://lh5.googleusercontent.com/-7ODSj6DaIig/TpsQEay0NqI/AAAAAAAABDs/8fz14wjADj0/s200/RenameIfCanWriteFileChooser.png)

* ↑10 ↓11 [#n0582bc7]
#adsensebar

** JFileChooserを開いた時のカレントディレクトリを設定する [#FileChooserCurrentDirectory]
#swingdescription(Swing/FileChooserCurrentDirectory,JFileChooserを開いた時のカレントディレクトリを設定する,JFileChooserを開いた時のカレントディレクトリを設定します。,https://lh5.googleusercontent.com/-L0xUhPSuu1Y/UFaopCvyPFI/AAAAAAAABSg/JUQJkTi-0BI/s200/FileChooserCurrentDirectory.png)

** JFileChooserでの隠しファイルの非表示設定を変更する [#FileHidingEnabled]
#swingdescription(Swing/FileHidingEnabled,JFileChooserでの隠しファイルの非表示設定を変更する,JFileChooserで隠しファイルを表示するかどうかをポップアップメニューから切り替えます。,https://lh4.googleusercontent.com/-TSMPljQ02Ao/UyWixahVFzI/AAAAAAAACBw/n_Ctee0FJGQ/s200/FileHidingEnabled.png)

** JFileChooserを開いたときの初期フォーカスを設定する [#FileChooserInitialFocus]
#swingdescription(Swing/FileChooserInitialFocus,JFileChooserを開いたときの初期フォーカスを設定する,NimbusLookAndFeelを使用しているJFileChooserを開いた場合、ファイル名表示用のJTextFieldに初期フォーカスを設定します。,https://drive.google.com/thumbnail?id=1uW5FnfU0V3Yi9iBBMFV7uoN8M9IA2sskmg)

** Containerの子Componentを再帰的にすべて取得する [#GetComponentsRecursively]
#swingdescription(Swing/GetComponentsRecursively,Containerの子Componentを再帰的にすべて取得する,Containerの子Componentを再帰的にすべて取得するメソッドを作成し、JFileChooserに配置されたJTableを取得します。,https://drive.google.com/thumbnail?id=1NedWhPhVuMDTwrHRaFdW-YXZjdH-019yuw)

** JFileChooserで複数ファイルの選択を行う [#FileChooserMultiSelection]
#swingdescription(Swing/FileChooserMultiSelection,JFileChooserで複数ファイルの選択を行う,JFileChooserで複数ファイルの選択ができるように設定します。,https://drive.google.com/thumbnail?id=1-cun-rfsw3qiGmb6K8Fp5hlrAArduvrQHw)

** JFileChooserでローカライズされたシステムフォルダ名を使用しないよう設定 [#SystemExtensionHiding]
#swingdescription(Swing/SystemExtensionHiding,JFileChooserでローカライズされたシステムフォルダ名を使用しないよう設定,JFileChooserのPlacesBarでローカライズされたシステムフォルダ名が表示されないように設定します。,https://drive.google.com/thumbnail?id=1tvYX3gC3OiwWr8vnG5346sqWtA5k3G29cg)

** MetalLookAndFeelでJFileChooserの下部にコンポーネントを追加する [#FileChooserBottomAccessory]
#swingdescription(Swing/FileChooserBottomAccessory,MetalLookAndFeelでJFileChooserの下部にコンポーネントを追加する,MetalLookAndFeelを適用しているJFileChooserのファイルフィルタとボタンパネルの間にJComboBoxのような横長のコンポーネントを追加します。,https://drive.google.com/thumbnail?id=1Nyb4wo_ryaaCsJEgpGBxbIlYazx3FQVFfw)

** JFileChooserのファイル名とフィルタのラベルを右揃えに変更する [#FileChooserFileAndFilterAlignment]
#swingdescription(Swing/FileChooserFileAndFilterAlignment,JFileChooserのファイル名とフィルタのラベルを右揃えに変更する,JFileChooserの下部に表示されるファイル名とフィルタのラベルを左揃えから右揃えに変更します。,https://drive.google.com/thumbnail?id=1U4T22tNO7N5NZJUDujh3ZUh68fe-xyvbPw)

** JFileChooserのリスト表示を垂直1列に変更する [#FileChooserLayoutOrientation]
#swingdescription(Swing/FileChooserLayoutOrientation,JFileChooserのリスト表示を垂直1列に変更する,JFileChooserのリスト表示をデフォルトの垂直優先ニュースペーパースタイルから、JListのデフォルトである垂直1列スタイルに変更します。,https://drive.google.com/thumbnail?id=1h6JaUr4zBG52EWKWwBHP2unFTL_rm_r9HA)

** JFileChooserのファイル一覧にJToolTipを設定する [#FileChooserToolTips]
#swingdescription(Swing/FileChooserToolTips,JFileChooserのファイル一覧にJToolTipを設定する,JFileChooserの詳細ファイル一覧でファイル名が省略されている場合にJToolTipでそれを表示します。,https://drive.google.com/thumbnail?id=1GzSb_32IGNEjqMVqMCqzG2K8j41cSeKrdQ)

** JFileChooserで選択したzipファイルを展開する [#ZipFile]
#swingdescription(Swing/ZipFile,JFileChooserで選択したzipファイルを展開する,JFileChooserで選択したzipファイルを展開、またはディレクトリをzip圧縮します。,https://drive.google.com/thumbnail?id=11d4t5QVL41puZ84CA-a3BBWz6zx7_4dy1A)

* ↑20 ↓21 [#j653cefe]
#adsensebar

** JFileChooserのタイトルバーのIconImageを変更する [#FileChooserIconImage]
#swingdescription(Swing/FileChooserIconImage,JFileChooserのタイトルバーのIconImageを変更する,JFileChooserのタイトルバーアイコンを親のJFrameとは別のアイコンに変更します。,https://drive.google.com/thumbnail?id=1eUMSRA3bh0DZYC2DrIVsGRXTqW_ZsGmHCA)

** JComboBox、JList、JTreeなどの先頭文字列検索に使用するキー入力遅延時間を設定する [#TimeFactor]
#swingdescription(Swing/TimeFactor,JComboBox、JList、JTreeなどの先頭文字列検索に使用するキー入力遅延時間を設定する,JComboBox、JList、JTree、JFileChooserの詳細ビューなどで、キー入力による先頭文字列検索に使用する複数キー入力遅延時間を設定します。,https://drive.google.com/thumbnail?id=1tAZ74eWWmKaypcoCeBn4AGGjdHlb-j1KiA)

** JFileChooserの詳細表示でファイル名が編集中の場合はそれをキャンセルする [#FileChooserCancelEdit]
#swingdescription(Swing/FileChooserCancelEdit,JFileChooserの詳細表示でファイル名が編集中の場合はそれをキャンセルする,JFileChooserを詳細表示モードで表示したとき、前回のファイル名編集が継続中の場合はそれをキャンセルします。,https://drive.google.com/thumbnail?id=1mmE2-oPYGfml1EHlPd7pXonxZxiGUWpelQ)

** JFileChooserにTransferHandlerを設定してFileをドロップ可能にする [#DropFileOnFileChooser]
#swingdescription(Swing/DropFileOnFileChooser,JFileChooserにTransferHandlerを設定してFileをドロップ可能にする,JFileChooserにTransferHandlerを設定してFileやDirectoryをドロップ可能にします。,https://drive.google.com/thumbnail?id=1NA-vGQgCHGvMjG9nrxYwpTVuYCIgeFFZ)

** JFileChooserがディレクトリ選択モードの場合ファイルフィルタ用のJComboBoxを無効化する [#DisableFilterComboBox]
#swingdescription(Swing/DisableFilterComboBox,JFileChooserがディレクトリ選択モードの場合ファイルフィルタ用のJComboBoxを無効化する,JFileChooserがディレクトリのみ選択可能に設定されている場合、ファイルフィルタ用のJComboBoxを無効化します。,https://drive.google.com/thumbnail?id=1Ed1zBEdBgvUiUOVeBr4rXbopF_1aJgBg)

** JFileChooserのPlacesBarショートカットの初期値を変更する [#FileChooserShortcutPanelFolders]
#swingdescription(Swing/FileChooserShortcutPanelFolders,JFileChooserのPlacesBarショートカットの初期値を変更する,JFileChooserのPlacesBarショートカットフォルダの初期値をドキュメントからPCに変更します。,https://drive.google.com/thumbnail?id=1u-38lQnqii8nemRJxB3MkP1OoPDrgaZs)

** JFileChooserで新規フォルダ作成を無効化する [#DisableNewFolderAction]
#swingdescription(Swing/DisableNewFolderAction,JFileChooserで新規フォルダ作成を無効化する,JFileChooserで既存ファイルの名前変更は有効のまま新規フォルダの作成のみ無効に設定します。,https://drive.google.com/thumbnail?id=1a7Lm2pVbgfsEnORKxYiekYuJz_rAwCCI)

** JFileChooserのDetails Viewで行全体を選択可能にする [#FileViewFullRowSelection]
#swingdescription(Swing/FileViewFullRowSelection,JFileChooserのDetails Viewで行全体を選択可能にする,JFileChooserの詳細表示を行うJTableで行全体の選択状態表示とマウスによる行選択を可能に変更します。,https://drive.google.com/thumbnail?id=1Kmm_cFFBn4Ox_HtiEZwK3-cmZbWG7BkD)

** JFileChooserのファイル一覧で選択状態をWindowsスタイルに設定する [#FileChooserListViewWindowsStyle]
#swingdescription(Swing/FileChooserListViewWindowsStyle,JFileChooserのファイル一覧で選択状態をWindowsスタイルに設定する,JFileChooserのファイル一覧でファイルの選択状態やポップアップメニューのセパレータなどをWindows風の表示に変更します。,https://drive.google.com/thumbnail?id=1h9w0k8twLfHOwzNGtvXLIWL5SP75W68w)

** JFileChooserのテンプレート新規フォルダ名を変更する [#FileChooserNewFolder]
#swingdescription(Swing/FileChooserNewFolder,JFileChooserのテンプレート新規フォルダ名を変更する,JFileChooserで新規フォルダを作成するときに使用するテンプレートフォルダ名を変更します。,https://drive.google.com/thumbnail?id=1R2Ntdo5TiC-L9M31OVIzgq-U7J4nxixK)

* ↑30 ↓31 [#hdc6275a]
#adsensebar

** JFileChooserのセルエディタでリネームを開始したとき拡張子を除くファイル名を選択状態にする [#SelectFileNameWithoutExtension]
#swingdescription(Swing/SelectFileNameWithoutExtension,JFileChooserのセルエディタでリネームを開始したとき拡張子を除くファイル名を選択状態にする,JFileChooserのListViewやDetailsViewでリネーム可能なセルエディタとして使用されるJTextFieldを取得し、ファイル名全体ではなく拡張子を除くファイル名が選択状態になるよう設定します。,https://drive.google.com/thumbnail?id=1Q83JplI4_5QHhy5qekG6vSDpBZmQYuQv)

** JFileChooserの詳細表示でソートする列を指定する [#FileChooserSortKeys]
#swingdescription(Swing/FileChooserSortKeys,JFileChooserの詳細表示でソートする列を指定する,JFileChooserの詳細表示で使用するJTableが初期状態でソートする列を指定します。,https://drive.google.com/thumbnail?id=1LTwHuFGMBhjtnq2DZ4NSR765DYOeqXjW)

** JFileChooserのリサイズでファイル名編集をキャンセルする [#CancelFilePaneCellEditor]
#swingdescription(Swing/CancelFilePaneCellEditor,JFileChooserのリサイズでファイル名編集をキャンセルする,JFileChooserのFilePaneでCellEditorが表示中にJFileChooserのサイズ変更が発生した場合、そのリネームをキャンセルするComponentListenerを作成します。,https://drive.google.com/thumbnail?id=1g0K3CSMMj_MdIGjzm1Ofd3_qWPQR_Exe)

** JTreeで表示したフォルダ構造でWindowsのlnkショートカット先に移動する [#ResolveShortcutsLinkLocation]
#swingdescription(Swing/ResolveShortcutsLinkLocation,JTreeで表示したフォルダ構造でWindowsのlnkショートカット先に移動する,JTreeを使用して作成したフォルダ構造のTreeNodeがWindowsのlnkショートカットの場合、JFileChooserのShellFolderを利用してリンク先フォルダに移動可能にします。,https://drive.google.com/thumbnail?id=1GJkQrkphv_RF2UiMWmc-6wkSimFmnpQu)