I am writing a program in java. I have a main JPanel that has two JPanel and one Canvas added on it. I aim to resize the Canvas while running the program. When I maximized the Canvas i want it to be always on top of the other component.
How can I set this property for my Canvas?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Make your main JPanel a JLayeredPane
Then you can set the layer of the other components with
setLayer(Component c, int layer)
thus allowing them to overlap.You could replace your main JPanel with a JLayeredPanel. A layered panel will let you specify that some child components should be layered above other child components.
I.e.: