Swing/TreeExpandedIcon のバックアップ差分(No.5)
- バックアップ一覧
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Swing/TreeExpandedIcon へ行く。
- 1 (2010-05-31 (月) 15:21:37)
- 2 (2011-03-14 (月) 20:29:47)
- 3 (2013-01-01 (火) 16:27:01)
- 4 (2015-06-26 (金) 18:48:41)
- 5 (2017-03-17 (金) 13:46:11)
- 6 (2018-01-23 (火) 13:50:29)
- 7 (2020-01-15 (水) 18:37:26)
- 8 (2021-07-17 (土) 21:50:55)
- 9 (2025-01-03 (金) 08:57:02)
- 10 (2025-01-03 (金) 09:01:23)
- 11 (2025-01-03 (金) 09:02:38)
- 12 (2025-01-03 (金) 09:03:21)
- 13 (2025-01-03 (金) 09:04:02)
- 14 (2025-06-19 (木) 12:41:37)
- 15 (2025-06-19 (木) 12:43:47)
- 追加された行はこの色です。
- 削除された行はこの色です。
--- category: swing folder: TreeExpandedIcon title: JTreeの展開、折畳みアイコンを非表示にする tags: [JTree, Icon, UIManager] author: aterai pubdate: 2010-05-31T15:21:37+09:00 description: JTreeの展開、折畳みアイコンを変更して非表示にします。 image: https://lh6.googleusercontent.com/_9Z4BYR88imo/TQTWHHSFZMI/AAAAAAAAAos/aymKObZa7WQ/s800/TreeExpandedIcon.png --- * 概要 [#j8acc5d0] * 概要 [#summary] `JTree`の展開、折畳みアイコンを変更して非表示にします。 #download(https://lh6.googleusercontent.com/_9Z4BYR88imo/TQTWHHSFZMI/AAAAAAAAAos/aymKObZa7WQ/s800/TreeExpandedIcon.png) * サンプルコード [#h4c75a6a] * サンプルコード [#sourcecode] #code(link){{ Icon emptyIcon = new EmptyIcon(); Icon emptyIcon = new Icon() { @Override public void paintIcon(Component c, Graphics g, int x, int y) {} @Override public int getIconWidth() { return 0; } @Override public int getIconHeight() { return 0; } }; UIManager.put("Tree.expandedIcon", new IconUIResource(emptyIcon)); UIManager.put("Tree.collapsedIcon", new IconUIResource(emptyIcon)); }} * 解説 [#k9aa6922] * 解説 [#explanation] 上記のサンプルでは、サイズ`0`の`Icon`を`Tree.expandedIcon`, `Tree.collapsedIcon`として使用することで、それぞれ非表示になるように設定しています。 * 参考リンク [#g8ef9fe5] * 参考リンク [#reference] - [[JTableのソートアイコンを変更>Swing/TableSortIcon]] - [[JTreeのOpenIcon、ClosedIcon、LeafIconを変更>Swing/TreeLeafIcon]] * コメント [#o066ff04] * コメント [#comment] #comment #comment