简体   繁体   中英

How can i access one component over another using mouselistener

I have two or more j components. I want to place one component over the other by dragging the mouse and placing it over it.

While placing the component label 2 over label 1 the component label 2 must tell that it is placed over label 1. Similarly all components must tell on which component it is placed.

I think you're looking for Z-Indexing of components. There's another question related to this with links to examples. Here: Z-order on Java Swing components

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM