Swing/DrawsTreeFocus のバックアップ(No.8)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- Swing/DrawsTreeFocus へ行く。
- 1 (2014-09-17 (水) 02:15:51)
- 2 (2014-10-26 (日) 04:01:18)
- 3 (2015-04-05 (日) 23:11:14)
- 4 (2016-06-24 (金) 16:14:58)
- 5 (2017-09-21 (木) 04:37:55)
- 6 (2018-05-31 (木) 14:31:33)
- 7 (2020-05-21 (木) 18:55:16)
- 8 (2021-11-11 (木) 01:10:37)
- 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)
- category: swing
folder: DrawsTreeFocus
title: JTreeのノードがフォーカス状態になった場合のBorderを変更する
tags: [JTree, UIManager, Border, Focus, LookAndFeel]
author: aterai
pubdate: 2014-06-16T01:26:31+09:00
description: JTreeのノードが選択されてフォーカス状態になった場合のBorderによる描画をUIManagerで変更します。
image:
概要
JTree
のノードが選択されてフォーカス状態になった場合のBorder
による描画をUIManager
で変更します。
Screenshot

Advertisement
サンプルコード
UIManager.putBoolean("Tree.drawsFocusBorderAroundIcon", false);
UIManager.putBoolean("Tree.drawDashedFocusIndicator", false);
View in GitHub: Java, Kotlin解説
Tree.drawsFocusBorderAroundIcon
true
の場合JTree
のノードアイコンを囲むようにBorder
が拡張される- 背景色で塗りつぶされる範囲は変化しない
MotifLookAndFeel
の初期値はtrue
Tree.drawDashedFocusIndicator
true
の場合JTree
のフォーカスの描画に使用するBorder
が点線になるWindowsLookAndFeel
の初期値はtrue