I want to make a loading message when an app processes, so I used a JPanel over a JTree. But when the user clicks on the JPanel, the <
JPanel
JTree
You need a to use a JLayeredPane for moving components in front of each other.
Here is a tutorial: How to use Layered Panes