Swing/DisabledTextColor のバックアップ差分(No.3)
- バックアップ一覧
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Swing/DisabledTextColor へ行く。
- 1 (2008-10-06 (月) 14:59:33)
- 2 (2008-10-06 (月) 19:01:39)
- 3 (2013-01-17 (木) 15:22:57)
- 4 (2013-08-20 (火) 19:18:08)
- 5 (2013-09-12 (木) 01:13:05)
- 6 (2014-11-01 (土) 00:46:09)
- 7 (2014-11-25 (火) 03:03:31)
- 8 (2015-10-29 (木) 16:29:42)
- 9 (2017-04-21 (金) 13:23:02)
- 10 (2017-08-18 (金) 18:53:18)
- 11 (2017-11-02 (木) 15:34:40)
- 12 (2018-08-29 (水) 18:31:54)
- 13 (2020-08-23 (日) 17:14:06)
- 14 (2022-01-27 (木) 14:26:06)
- 15 (2022-08-20 (土) 22:15:25)
- 16 (2023-02-04 (土) 17:02:54)
- 17 (2023-02-06 (月) 00:00:50)
- 追加された行はこの色です。
- 削除された行はこの色です。
TITLE:JCheckBoxなどの編集不可文字色を変更 TITLE:JCheckBoxなどが無効な状態での文字色を変更 #navi(../) *JCheckBoxなどの編集不可文字色を変更 [#kf3c0d46] Posted by [[terai]] at 2008-10-06 #tags(JCheckBox, JComboBox, UIManager, JLabel, JButton) RIGHT:Posted by &author(aterai); at 2008-10-06 *JCheckBoxなどが無効な状態での文字色を変更 [#r5ed5917] ``JCheckBox``や``JComboBox``などのコンポーネントが無効な状態になった場合の文字色を変更します。 #contents **概要 [#mdabb408] JCheckBoxやJComboBoxなどのコンポーネントが編集不可になった場合の文字色を変更します。 -&jnlp; -&jar; -&zip; #screenshot //#screenshot #ref(http://lh5.ggpht.com/_9Z4BYR88imo/TQTLDPDIq4I/AAAAAAAAAW8/jt2A5D74G04/s800/DisabledTextColor.png) **サンプルコード [#q9537f41] #code{{ #code(link){{ UIManager.put("CheckBox.disabledText", Color.RED); JCheckBox cbx1 = new JCheckBox("default", true); JCheckBox cbx2 = new JCheckBox("<html>html tag</html>", true); }} **解説 [#l33eb0b4] -JCheckBox --UIManager.put("CheckBox.disabledText", Color.RED) ---Metal Look&Feel でのみ?、反映される -JCheckBox(html) --<html>タグを使った場合、setEnableにかかわらず、文字色は変更不可([[Bug ID: 4740519 HTML JLabel not greyed out on setEnabled(false)>http://bugs.sun.com/view_bug.do?bug_id=4740519]])を利用 ---参考:[[Swing - How to disable a JCheckBox and leave the text the original color?>http://forums.sun.com/thread.jspa?threadID=5328889]]のMichael_Dunn さんの投稿 -``JCheckBox`` --``UIManager.put("CheckBox.disabledText", Color.RED)`` ---``MetalLookAndFeel``でのみ?、反映される -``JCheckBox`` + ``html`` --``<html>``タグを使った場合、``setEnable``にかかわらず、文字色は変更不可([http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4740519 Bug ID: 4740519 HTML JLabel not greyed out on setEnabled(false)])を利用 ---参考:[http://forums.sun.com/thread.jspa?threadID=5328889 Swing - How to disable a JCheckBox and leave the text the original color?]のMichael_Dunn さんの投稿 ---[[Htmlを使ったJLabelとJEditorPaneの無効化>Swing/DisabledHtmlLabel]] -JComboBox --UIManager.put("ComboBox.disabledForeground", Color.GREEN); -JComboBox(html) -``JComboBox`` --``UIManager.put("ComboBox.disabledForeground", Color.GREEN);`` -``JComboBox + ``html`` --レンダラーで文字色を変更 -JLabel --UIManager.put("Label.disabledForeground", Color.ORANGE); -JButton --UIManager.put("Button.disabledText", Color.YELLOW) ---Metal Look&Feel でのみ?、反映される -``JComboBox``(``Editable``) --``EditorComponent``を取得して、``editor.setDisabledTextColor(Color.PINK);``を設定 -``JLabel`` --``UIManager.put("Label.disabledForeground", Color.ORANGE);`` -``JButton`` --``UIManager.put("Button.disabledText", Color.YELLOW)`` ---``MetalLookAndFeel``でのみ?、反映される #screenshot(,screenshot1.png) //#screenshot(,screenshot1.png) #ref(http://lh5.ggpht.com/_9Z4BYR88imo/TQTLFT1HGFI/AAAAAAAAAXA/W5L-yIFc61E/s800/DisabledTextColor1.png) //**参考リンク **コメント [#w6daf1af] #comment