Click here to Skip to main content
15,902,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every body,
I'm using JLayeredPane  to draw several layers, each layer has different depth 
my question is: how can i change the layer depth at run time?
i need to change the depth of previewMap from 0 to 1, and the depth of mapControlPanel from 1 to 0


Java
JLayeredPane layeredPane = new JLayeredPane ();
JPanel previewMap = new JPanel();
JPanel mapControlPanel = new JPanel(new BorderLayout());
layeredPane.add(previewMap, Integer.valueOf(0));
layeredPane.add(mapControlPanel, Integer.valueOf(1));
Posted
Comments
TorstenH. 30-May-14 4:49am    
Layer depth? Do you want to add or remove panels to the layout?

or are you talking about the z-index, which decides what is displayed in front and back?
tarekwarak0 30-May-14 10:19am    
Thank you very much, I'm talking about the z-index, how can i change the z-index in the run time?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900