Swing/AnimatedToolTip のバックアップの現在との差分(No.4)
- バックアップ一覧
- 差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Swing/AnimatedToolTip へ行く。
- 1 (2007-04-23 (月) 09:48:54)
- 2 (2010-12-12 (日) 23:19:07)
- 3 (2014-10-02 (木) 03:46:55)
- 4 (2015-03-02 (月) 11:23:22)
- 5 (2017-01-17 (火) 15:04:14)
- 6 (2017-12-15 (金) 14:29:05)
- 7 (2018-03-25 (日) 16:48:22)
- 8 (2018-10-15 (月) 13:19:00)
- 9 (2020-10-11 (日) 20:21:34)
- 10 (2022-07-10 (日) 04:43:58)
- 11 (2024-02-15 (木) 20:21:06)
- 12 (2024-05-09 (木) 18:01:14)
- 13 (2024-06-30 (日) 02:37:58)
- 14 (2025-01-03 (金) 08:57:02)
- 15 (2025-01-03 (金) 09:01:23)
- 16 (2025-01-03 (金) 09:02:38)
- 17 (2025-01-03 (金) 09:03:21)
- 18 (2025-01-03 (金) 09:04:02)
- 19 (2025-06-19 (木) 12:41:37)
- 20 (2025-06-19 (木) 12:43:47)
- 追加された行はこの色です。
- 削除された行はこの色です。
--- category: swing folder: AnimatedToolTip title: JToolTipのアニメーション tags: [JToolTip, Animation, Html] tags: [JToolTip, JLabel, Animation, AnimatedGif, Html] author: aterai pubdate: 2007-04-23T09:48:54+09:00 description: ツールチップにアニメーションするアイコンを使用します。 description: JToolTipが表示されたとき、内部のJLabelでアイコンのアニメーションを行う方法をテストします。 image: https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTHpat_rFI/AAAAAAAAARg/fzkRLOHGb7I/s800/AnimatedToolTip.png --- * 概要 [#c6a726d0] ツールチップにアニメーションするアイコンを使用します。 * Summary [#summary] `JToolTip`が表示されたとき、内部の`JLabel`でアイコンのアニメーションを行う方法をテストします。 #download(https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTHpat_rFI/AAAAAAAAARg/fzkRLOHGb7I/s800/AnimatedToolTip.png) * サンプルコード [#vc930fab] * Source Code Examples [#sourcecode] #code(link){{ ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("example/anime.gif"); JLabel l3 = new JLabel("Gif Animated ToolTip(html)"); l3.setToolTipText("<html><img src='" + url + "'>Test3</html>"); l3.setToolTipText(String.format("<html><img src='%s'>Test3", url)); }} * 解説 [#gc9b2704] - 上 -- `javax.swing.Timer`を使ってアニメーションするラベルを使用しています。 * Description [#description] - `Timer Animated ToolTip` -- `javax.swing.Timer`を使ってアニメーションを実行する`JLabel`を作成して`JToolTip`に配置 -- [[Timerでアニメーションするアイコンを作成>Swing/AnimeIcon]] #code{{ JLabel l1 = new JLabel("Timer Animated ToolTip") { @Override public JToolTip createToolTip() { JToolTip tip = new AnimatedToolTip(new AnimatedLabel("")); tip.setComponent(this); return tip; } }; l1.setToolTipText(" "); }} - 中 -- アニメ`GIF`ファイルをアイコンとして使用しています。 - `Gif Animated ToolTip` -- `Animated GIF`ファイルを`JLabel#setIcon(Icon)`で設定した`JLabel`を`JToolTip`に配置 #code{{ JLabel l2 = new JLabel("Gif Animated ToolTip") { @Override public JToolTip createToolTip() { JToolTip tip = new AnimatedToolTip( new JLabel("", new ImageIcon(url), SwingConstants.LEFT)); tip.setComponent(this); return tip; } }; }} - 下 -- アニメ`GIF`ファイルを`html`タグを使って貼り付けています。 - `Gif Animated ToolTip(html)` -- `Animated GIF`ファイルを`<html>`タグを使って`setToolTipText(...)`メソッドで設定 * 参考リンク [#r1317886] * Reference [#reference] - [[JToolTipにアイコンを表示>Swing/ToolTipIcon]] - [[Timerでアニメーションするアイコンを作成>Swing/AnimeIcon]] - [[TrayIconのアニメーション>Swing/AnimatedTrayIcon]] * コメント [#vf777372] * Comment [#comment] #comment #comment