1

I have a window with an xyz-panel that holds a bunch of labels. Now some of them have to overlap and I can't figure out how to set the Z-order.

(defn- mk-smhi-frame
    "create the frame"
    []
    (sc/window
        :width 1920
        :height 1080
        :content
        (sc/xyz-panel :items [
            ; begin snip
            (sc/label :id         :clock
                      :bounds     [1000 0 920 500]
                      :paint      draw-clock)
            ;----------------------------------------------
            ; how do make :radar be on top of :clock?
            ;----------------------------------------------
            (sc/label :id         :radar
                      :bounds     [1200 100 500 300]
                      :paint      draw-radar)
            ; end snip
            ])))
Kingfranz
  • 184
  • 1
  • 12
  • 1
    example code please. – erdos Oct 02 '17 at 14:01
  • Possible duplicate of [Z-order on Java Swing components](https://stackoverflow.com/questions/4229638/z-order-on-java-swing-components) – ntalbs Oct 02 '17 at 16:07
  • I've looked at that one, but seesaw doesn't support any of the methods used in that post – Kingfranz Oct 02 '17 at 16:21
  • 2
    A quick grep through the source makes it clear that `move-to-front!` and `move-to-back!` functions (defined for any Movable, a protocol implemented for `java.util.EventObject`, `java.awt.Component` or `java.awt.Window`) invoke `setComponentZOrder`. – Charles Duffy Oct 02 '17 at 20:40
  • That might be it, thanks! Pity it isn't mentioned in docs. – Kingfranz Oct 03 '17 at 15:56

0 Answers0