src/Pure/System/gui.scala
changeset 53778 29eaacff4078
parent 53714 89fb20ae9b73
--- a/src/Pure/System/gui.scala	Sat Sep 21 19:48:46 2013 +0200
+++ b/src/Pure/System/gui.scala	Sat Sep 21 20:31:03 2013 +0200
@@ -8,7 +8,7 @@
 
 
 import java.awt.{Image, Component, Container, Toolkit, Window}
-import javax.swing.{ImageIcon, JOptionPane, UIManager}
+import javax.swing.{ImageIcon, JOptionPane, UIManager, JLayeredPane, JFrame, JWindow}
 
 import scala.swing.{ComboBox, TextArea, ScrollPane}
 import scala.swing.event.SelectionChanged
@@ -143,5 +143,12 @@
 
   def parent_window(component: Component): Option[Window] =
     ancestors(component).collectFirst({ case x: Window => x })
+
+  def layered_pane(component: Component): Option[JLayeredPane] =
+    parent_window(component) match {
+      case Some(window: JWindow) => Some(window.getLayeredPane)
+      case Some(frame: JFrame) => Some(frame.getLayeredPane)
+      case _ => None
+    }
 }