Swing/DrawsTreeFocus のバックアップソース(No.6)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/DrawsTreeFocus へ行く。
--- 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: https://lh3.googleusercontent.com/-I62wWvQhdQI/U53BUsVLj9I/AAAAAAAACHk/SSHVLXv9m28/s800/DrawsTreeFocus.png --- * 概要 [#summary] `JTree`のノードが選択されてフォーカス状態になった場合の`Border`による描画を`UIManager`で変更します。 #download(https://lh3.googleusercontent.com/-I62wWvQhdQI/U53BUsVLj9I/AAAAAAAACHk/SSHVLXv9m28/s800/DrawsTreeFocus.png) * サンプルコード [#sourcecode] #code(link){{ UIManager.putBoolean("Tree.drawsFocusBorderAroundIcon", false); UIManager.putBoolean("Tree.drawDashedFocusIndicator", false); }} * 解説 [#explanation] - `Tree.drawsFocusBorderAroundIcon` -- `true`の場合、`JTree`のノードアイコンを囲むように`Border`が拡張される --- 背景色で塗りつぶされる範囲は変化しない -- `MotifLookAndFeel`の初期値は`true` - `Tree.drawDashedFocusIndicator` -- `true`の場合、`JTree`のフォーカスの描画に使用する`Border`が点線になる -- `WindowsLookAndFeel`の初期値は`true` //* 参考リンク [#reference] * コメント [#comment] #comment #comment