Swing/ToolTipBorder のバックアップソース(No.8)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/ToolTipBorder へ行く。
- 1 (2005-09-13 (火) 00:22:53)
- 2 (2006-02-27 (月) 16:50:00)
- 3 (2006-04-12 (水) 20:36:06)
- 4 (2007-03-20 (火) 16:15:36)
- 5 (2007-10-10 (水) 18:52:42)
- 6 (2013-03-27 (水) 16:37:21)
- 7 (2014-11-25 (火) 02:24:07)
- 8 (2014-12-01 (月) 17:23:05)
- 9 (2014-12-04 (木) 14:28:27)
- 10 (2016-03-10 (木) 15:16:31)
- 11 (2016-08-12 (金) 15:36:54)
- 12 (2017-10-04 (水) 18:23:43)
- 13 (2018-03-02 (金) 15:17:26)
- 14 (2020-03-17 (火) 18:28:59)
- 15 (2021-09-15 (水) 10:28:23)
--- title: JToolTipにBorderを設定 tags: [JToolTip, Border] author: aterai pubdate: 2005-08-15 description: JComponent#createToolTip()メソッドをオーバーライドして、`Border`を変更したJToolTipを生成します。 --- * 概要 [#kfc70601] `JComponent#createToolTip()`メソッドをオーバーライドして、`Border`を変更した`JToolTip`を生成します。 #download(https://lh6.googleusercontent.com/_9Z4BYR88imo/TQTVjcQsX6I/AAAAAAAAAn0/tieki8bniAM/s800/ToolTipBorder.png) * サンプルコード [#hae3c35e] #code(link){{ JButton button = new JButton() { @Override public JToolTip createToolTip() { JToolTip tip = new JToolTip(); Border b1 = tip.getBorder(); Border b2 = BorderFactory.createMatteBorder(0, 10, 0, 0, Color.GREEN); tip.setBorder(BorderFactory.createCompoundBorder(b1, b2)); tip.setComponent(this); return tip; } }; button.setToolTipText("テスト"); }} * 解説 [#mf29af77] 上記のサンプルでは、`JComponent#createToolTip()`メソッドをオーバーライドし、その中で`Border`を設定した`JToolTip`を生成しています。 //* 参考リンク * コメント [#s0820c45] #comment #comment