Layering Objects (That extend JComponet) on JApplet

前端 未结 2 1176
旧巷少年郎
旧巷少年郎 2020-12-21 20:41

I currently have a JApplet within which I add two objects that both extend JComponet. Object A is basically a large square and object B is a small square, I need Object B to

相关标签:
2条回答
  • 2020-12-21 21:01

    You might look at JLayeredPane, seen here, or OverlayLayout, seen here. Either should work in an applet, but this hybrid approach may offer additional flexibility.

    JLayeredPane

    OverlayLayout

    0 讨论(0)
  • 2020-12-21 21:02

    You may want to look at this method: Container.setComponentZOrder(Component comp, int index)

    0 讨论(0)
提交回复
热议问题