src/Pure/GUI/popup.scala
changeset 73340 0ffcad1f6130
parent 64370 865b39487b5d
child 75393 87ebf5a50283
equal deleted inserted replaced
73339:9efdebe24c65 73340:0ffcad1f6130
    15   layered: JLayeredPane,
    15   layered: JLayeredPane,
    16   component: JComponent,
    16   component: JComponent,
    17   location: Point,
    17   location: Point,
    18   size: Dimension)
    18   size: Dimension)
    19 {
    19 {
    20   def show
    20   def show: Unit =
    21   {
    21   {
    22     component.setLocation(location)
    22     component.setLocation(location)
    23     component.setSize(size)
    23     component.setSize(size)
    24     component.setPreferredSize(size)
    24     component.setPreferredSize(size)
    25     component.setOpaque(true)
    25     component.setOpaque(true)
    26     layered.add(component, JLayeredPane.DEFAULT_LAYER)
    26     layered.add(component, JLayeredPane.DEFAULT_LAYER)
    27     layered.moveToFront(component)
    27     layered.moveToFront(component)
    28     layered.repaint(component.getBounds())
    28     layered.repaint(component.getBounds())
    29   }
    29   }
    30 
    30 
    31   def hide
    31   def hide: Unit =
    32   {
    32   {
    33     val bounds = component.getBounds()
    33     val bounds = component.getBounds()
    34     layered.remove(component)
    34     layered.remove(component)
    35     layered.repaint(bounds)
    35     layered.repaint(bounds)
    36   }
    36   }