I've been looking all over for some mention of this, but I cannot find any substantial information on it. Is there a way to change the z-order of Swing components, or at least change the draw order so that they appear to be above others?
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.
来源:https://stackoverflow.com/questions/4229638/z-order-on-java-swing-components