Swing/LayeredPane のバックアップソース(No.19)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/LayeredPane へ行く。
- 1 (2004-06-21 (月) 07:16:58)
- 2 (2004-06-21 (月) 07:24:32)
- 3 (2004-08-17 (火) 08:49:35)
- 4 (2004-10-08 (金) 08:00:59)
- 5 (2004-11-04 (木) 10:09:17)
- 6 (2004-12-24 (金) 03:00:00)
- 7 (2005-04-28 (木) 04:33:08)
- 8 (2005-10-30 (日) 17:50:12)
- 9 (2006-02-27 (月) 16:07:22)
- 10 (2006-09-05 (火) 16:37:12)
- 11 (2007-04-10 (火) 16:19:57)
- 12 (2007-10-12 (金) 19:37:58)
- 13 (2008-03-14 (金) 21:42:26)
- 14 (2008-05-09 (金) 15:19:12)
- 15 (2008-06-11 (水) 16:59:42)
- 16 (2013-04-10 (水) 02:43:36)
- 17 (2014-11-01 (土) 00:46:09)
- 18 (2015-03-13 (金) 13:07:20)
- 19 (2016-06-04 (土) 19:23:17)
- 20 (2017-09-12 (火) 14:24:59)
- 21 (2018-08-30 (木) 14:58:47)
- 22 (2020-08-27 (木) 18:26:37)
- 23 (2022-02-01 (火) 22:41:27)
- 24 (2022-08-20 (土) 22:15:25)
--- title: JInternalFrameを一番手前に表示 tags: [JLayeredPane, JInternalFrame, JDesktopPane] author: aterai pubdate: 2004-06-21T07:16:58+09:00 description: JLayeredPaneを使って、常に一番手前に表示されるJInternalFrameを作成します。 --- * 概要 [#nf40bd6e] `JLayeredPane`を使って、常に一番手前に表示される`JInternalFrame`を作成します。 #download(https://lh5.googleusercontent.com/_9Z4BYR88imo/TQTO8wLpaZI/AAAAAAAAAdM/mML3cGeQwrg/s800/LayeredPane.png) * サンプルコード [#m9667d72] #code(link){{ JInternalFrame iframe = new JInternalFrame("AlwaysOnTop", true, //resizable false, //closable true, //maximizable true); //iconifiable iframe.setSize(180, 180); desktop.add(iframe, Integer.valueOf(JLayeredPane.MODAL_LAYER + 1)); iframe.setVisible(true); }} * 解説 [#b28fb803] `JDesktopPane`は、`JLayeredPane`を継承しているので、`JInternalFrame`を追加するレイヤーを指定することができます。 このサンプルでは、タイトルが`AlwaysOnTop`の`JInternalFrame`を、`JLayeredPane.MODAL_LAYER`の一つ上に設定し、他の`JInternalFrame`(ここでは後から追加する`JInternalFrame`)より常に手前に表示されるように設定しています。 * 参考リンク [#a60bf0d2] - メモ:[http://d.hatena.ne.jp/tori31001/20060901 JInternalFrameは最初にアイコン化しておかないと位置が更新されない] -- [http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4110799 Bug ID: 4110799 JInternalFrame icon position unchanged w/ resize] * コメント [#v1a558f1] #comment - `JDK 1.5.0`で`JFrame`などは、`frame.setAlwaysOnTop(true)`が使えるようになっています。 -- &user(aterai); &new{2004-10-08 (金) 17:00:59}; - ありがとうございます。現在`GUI`の作成をしていて、目下この情報を探していました。ありがとうございました -- &user(G); &new{2004-12-24 (金) 12:00:00}; -- どういたしまして。 -- [[aterai]] #comment