Z-order on Java Swing components

删除回忆录丶 提交于 2019-11-29 13:16:51
Amir Afghani

You are looking for setComponentZOrder

Here's an example.

If you want to overlay components over other components, you should use JLayeredPane, which will let you add components to specific layers. This is precisely what's used for things like tooltips and drag-and-drop operations.

Here's a tutorial for it as well.

Look at the setComponentZOrder(...) method of the Container class.

You can also check out the Overlap Layout which has a brief description on how ZOrder works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!