title: Embed LWJGL Display within Canvas without decoration
body: <p>I'm using Scala swing to display a window which needs to contain an LWJGL Display object. The only method I've found is it use an intermediary AWT Canvas instance to bind the Display object to and wrap inside a Frame:</p>
  
  <pre><code>object Run extends SimpleSwingApplication {
  
   System.setProperty("org.lwjgl.opengl.Window.undecorated", "true")
  
    val initialWindowSize = new Dimension(256, 240)
  
    lazy val top = new MainFrame {
      title = s"Nescala ${nescala.BuildInfo.version}"
      size = initialWindowSize
  
      visible = true
  
      peer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
      peer.setFocusable(true)
      peer.setIgnoreRepaint(true)
  
      peer.add(canvas)
  
      peer.pack()
    }
  
    def canvas:Canvas = new Canvas {
      setPreferredSize(initialWindowSize)
      setSize(initialWindowSize)
      setFocusable(true)
      setIgnoreRepaint(true)
      requestFocus()
      setVisible(true)
  
      override def addNotify() = {
        super.addNotify()
        attachDisplay()
      }
  
      override def removeNotify() = {
        detachDisplay()
        super.removeNotify()
      }
  
      def attachDisplay(): Unit = {
        try {
          Display.setParent(this)
          Display.create
  
        } catch {
          case e:LWJGLException =&gt; e.printStackTrace()
        }
      }
  
      def detachDisplay():Unit = Display.destroy()
    }
  }
  </code></pre>
  
  <p>However when the window is initialized and the display is attached it appears positioned beneath the top of the Canvas/Frame, possibly including the height of a titlebar:
  <a href="https://i.stack.imgur.com/c3Lwx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c3Lwx.png" alt="Black bar shows gap between Canvas &amp; LWJGL Display"></a><br>
  How can the Display be attached to the Canvas with the same dimensions? I was under the impression that the window dimensions were set from the parent, although I have tried to explicitly set a DisplayMode using the same values. Additionally, is it possible to use an LWJGL Display object without having a heavyweight AWT Canvas object set as the parent (but still within a Swing Ui element)?</p>