JInternalFrameを一番手前に表示
Total: 12562, Today: 1, Yesterday: 0
Posted by aterai at
Last-modified:
Summary
JLayeredPaneを使って、常に一番手前に表示されるJInternalFrameを作成します。
Screenshot

Advertisement
Source Code Examples
JInternalFrame iframe = new JInternalFrame(
"AlwaysOnTop", // title
true, // resizable
false, // closable
true, // maximizable
true); // iconifiable
iframe.setSize(180, 180);
desktop.add(iframe, Integer.valueOf(JLayeredPane.MODAL_LAYER + 1));
iframe.setVisible(true);
View in GitHub: Java, KotlinDescription
JDesktopPaneはJLayeredPaneを継承しているため、JInternalFrameを追加するレイヤーを指定可能です。このサンプルでは、タイトルがAlwaysOnTopのJInternalFrameをJLayeredPane.MODAL_LAYERの一つ上に設定し、他のJInternalFrame(ここでは後から追加するJInternalFrame)より常に手前に表示されるように設定しています。