To gain some flexibility in Java and Swing, I've been playing around with creating a "PlayingCard" component and implementing some simple card games. PlayingCard extends JPanel and simply uses two JLabels to display a suit icon and a number. PlayingCard also catches mouseDragged, etc. so that you can move the PlayingCard object around inside of its parent app/applet. Works great.
But - the cards stay in the "Z Order" in which they were added. That is, the first card add()'ed will always appear on top of all others, the last card will always appear under all others. How can I "bring to top" a particular Component? Java probably uses different terminology for this than I'm used to, and I just can't find it.
Thanks!
But - the cards stay in the "Z Order" in which they were added. That is, the first card add()'ed will always appear on top of all others, the last card will always appear under all others. How can I "bring to top" a particular Component? Java probably uses different terminology for this than I'm used to, and I just can't find it.
Thanks!