Swing/ApproveButtonText のバックアップソース(No.7)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/ApproveButtonText へ行く。
- 1 (2008-10-20 (月) 14:22:27)
- 2 (2009-10-09 (金) 20:01:14)
- 3 (2009-10-09 (金) 21:09:52)
- 4 (2010-06-14 (月) 02:28:39)
- 5 (2010-06-15 (火) 18:02:19)
- 6 (2010-12-12 (日) 23:20:47)
- 7 (2011-08-22 (月) 20:23:48)
- 8 (2012-02-17 (金) 18:23:19)
- 9 (2014-11-01 (土) 00:46:09)
- 10 (2014-11-09 (日) 02:51:13)
- 11 (2015-12-11 (金) 03:25:11)
- 12 (2016-05-24 (火) 22:01:23)
- 13 (2016-05-25 (水) 13:11:16)
- 14 (2016-06-03 (金) 13:28:46)
- 15 (2017-03-31 (金) 16:12:02)
- 16 (2017-10-18 (水) 13:39:22)
- 17 (2017-11-02 (木) 15:34:40)
- 18 (2019-03-15 (金) 17:07:59)
- 19 (2020-12-25 (金) 14:54:03)
- 20 (2022-08-20 (土) 22:15:25)
- 21 (2023-06-03 (土) 20:53:23)
- 22 (2023-08-30 (水) 09:50:23)
TITLE:JFileChooserのボタンテキストを変更 #navi(../) RIGHT:Posted by [[aterai]] at 2008-10-20 *JFileChooserのボタンテキストを変更 [#q32fca17] JFileChooserのボタンテキストを変更します。 //-&jnlp; -&jar; -&zip; //#screenshot #ref(http://lh4.ggpht.com/_9Z4BYR88imo/TQTHw6_sLrI/AAAAAAAAARs/5fsN5G2p15U/s800/ApproveButtonText.png) **サンプルコード [#b602fe55] #code{{ //UIManager.put("FileChooser.saveButtonText", "保存(S)"); //UIManager.put("FileChooser.openButtonText", "開く(O)"); UIManager.put("FileChooser.cancelButtonText", "キャンセル"); JFileChooser fileChooser = new JFileChooser(); //fileChooser.setApproveButtonText("開く(O)"); //fileChooser.setApproveButtonMnemonic('O'); }} **解説 [#d57fefff] 上記のサンプルは、日本語のWindowsLnFに合わせてJFileChooserのApproveButtonやキャンセルボタンのテキストを以下のように変更しています。 -%%OpenDialogのデフォルトでは、ファイルリストでフォルダが選択されていると「開く(O)」、ファイルが選択されていると「開く」で切り替わるとボタンサイズが変化してしまうため、「開く(O)」に揃える%% -%%SaveDialogのデフォルトでは、ファイルリストでフォルダが選択されていると「開く(O)」、ファイルが選択されていると「保存」なので、「保存(S)」に揃える%% --CancelButtonのデフォルトは、「取消し」でSaveDialogのフォルダ・ファイルの選択が切り替わるとボタンサイズが変化するので、二文字分長い「キャンセル」に変更 //**参考リンク **コメント [#m3d63c30] - 1.6.0_12 以降、デフォルトではMnemonicの表示がなくなっているようです(もしかしてバグだった?)。 -- [[aterai]] &new{2009-10-09 (金) 20:01:14}; -- メモ: [[Bug ID: 5045878 [ja] extra mnemonic characters on control buttons in JFileChooser>http://bugs.sun.com/view_bug.do?bug_id=5045878]] でも、1.6.0は関係なさそう…。 -- [[aterai]] &new{2009-10-09 (金) 20:16:41}; - 6u18で復活:[http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6785462 Bug ID: 6785462 Missing "(O)" in JFileChooser Open button in Windows LAF] -- [[aterai]] &new{2010-06-14 (月) 02:28:39}; #comment