Bring a component on a JPanel to front (Java)

后端 未结 5 739
花落未央
花落未央 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 20:53

    you can also use the LayeredPane of your JFrame. With JFrame.getLayeredPane() you get a reference of the pane in use.

    the add method of LayeredPane has up to 2 additional int parameters. the first specified the Layer of the component you'd add and the second contols the order inside this layer.

    You can find more infos at http://download.oracle.com/javase/tutorial/uiswing/components/rootpane.html#layeredpane

提交回复
热议问题