Bring a component on a JPanel to front (Java)

后端 未结 5 705
花落未央
花落未央 2021-01-11 20:27

In VB, you can use zOrder. In .Net, it\'s .SetChildIndex.

Before you ask, no I\'m not using a layout manager in this case. If you have two

5条回答
  •  温柔的废话
    2021-01-11 21:00

    When compnents overlap on the panel then you need to tell the panel so it can make sure it repaints the components in their proper ZOrder:

    You do this by overriding the isOptimizedDrawingEnabled() method of the JPanel to return false.

提交回复
热议问题