Swing/ForceHeavyWeightPopupKey のバックアップソース(No.2)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/ForceHeavyWeightPopupKey へ行く。
- 1 (2009-05-11 (月) 16:10:58)
- 2 (2009-05-13 (水) 12:59:21)
- 3 (2009-09-03 (木) 19:02:29)
- 4 (2012-03-24 (土) 00:45:46)
- 5 (2013-01-09 (水) 21:04:47)
- 6 (2013-01-10 (木) 01:38:45)
- 7 (2013-05-26 (日) 05:33:58)
- 8 (2013-06-18 (火) 08:34:11)
- 9 (2013-06-18 (火) 14:05:50)
- 10 (2013-06-18 (火) 17:17:37)
- 11 (2013-08-18 (日) 01:01:13)
- 12 (2013-08-28 (水) 12:23:06)
- 13 (2014-11-01 (土) 00:46:09)
- 14 (2014-11-08 (土) 01:41:12)
- 15 (2014-11-25 (火) 03:03:31)
- 16 (2015-02-02 (月) 17:32:47)
- 17 (2016-05-12 (木) 20:05:06)
- 18 (2017-04-07 (金) 13:51:51)
- 19 (2017-07-31 (月) 18:38:45)
- 20 (2017-10-27 (金) 16:26:13)
- 21 (2017-11-02 (木) 15:34:40)
- 22 (2018-08-01 (水) 21:29:33)
- 23 (2020-08-06 (木) 12:17:15)
- 24 (2021-12-28 (火) 12:18:53)
- 25 (2022-08-20 (土) 22:15:25)
- 26 (2022-10-03 (月) 14:56:24)
- 27 (2022-10-04 (火) 15:56:13)
TITLE:JToolTipをGlassPane上のコンポーネントで表示する #navi(../) RIGHT:Posted by [[terai]] at 2009-05-11 *JToolTipをGlassPane上のコンポーネントで表示する [#d46a12cd] JToolTipをGlassPane上のコンポーネントに追加した場合でも、手前に表示されるように設定します。主に[[Swing - ComboBox scroll and selected/highlight on glasspane>http://forums.sun.com/thread.jspa?threadID=5315492]]を参考にしています。 -&jnlp; -&jar; -&zip; #screenshot **サンプルコード [#f0477f43] #code{{ //Swing - ComboBox scroll and selected/highlight on glasspane //http://forums.sun.com/thread.jspa?threadID=5315492 try { Class clazz = Class.forName("javax.swing.PopupFactory"); Field field = clazz.getDeclaredField("forceHeavyWeightPopupKey"); field.setAccessible(true); label2.putClientProperty(field.get(null), Boolean.TRUE); } catch (Exception ex) { ex.printStackTrace(); } }} **解説 [#rec54369] 上記のサンプルでは、ボタンをクリックすると、二つのラベルをもつGlassPaneが表示されます。 -111...(左) --GlassPaneの下にJTooltipが表示される --親フレームの外にJTooltipがはみ出す場合は、正常に表示される --ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); では効果なし? -222...(右) --正常に表示されるように、常に、JTooltipを重量コンポーネントとして表示している --PopupFactoryクラスの forceHeavyWeightPopupKey をリフレクションで取得して、JComponent#putClientPropertyメソッドで設定 --[[Swing - ComboBox scroll and selected/highlight on glasspane>http://forums.sun.com/thread.jspa?threadID=5315492]]のGlassPaneでJComboBoxのポップアップを正常に表示する方法を引用 **参考リンク [#webb6ab8] -[[Swing - ComboBox scroll and selected/highlight on glasspane>http://forums.sun.com/thread.jspa?threadID=5315492]] -[[JComboBox の GlassPane 上でのレンダリング>http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?mode=viewtopic&topic=42615&forum=12]] -[[Swing - Why glass pane requires setLightWeightPopupEnabled(false)?>http://forums.sun.com/thread.jspa?threadID=5245072]] -[[JInternalFrameをModalにする>http://terai.xrea.jp/Swing/ModalInternalFrame.html]] **コメント [#n67c57a8] #comment