1) Does each component within a container have a unique z-order int? In other words, when I use container.setComponentZOrder( component, 0 ) does that increment the z-order of all the other components in that container? If so I should be able to use this to implement "bring to front" "sent to back" etc. ala Microsoft Office.
2) I know the z-order effects the order that components are drawn in but does it also effect when mouseEntered and mouseExited events occur? If I add two overlapping components to a container, the second one added is drawn on top and receives mouse events for the overlapping region. If I bring the first component to the top using setComponentZOrder I want to change both the drawing order and the mouse event receiver.
3) Why aren't getComponentZOrder and setComponentZOrder documented in the Java API? Eclipse tells me they exist and provides documentation on them...
Not sure about 1 and 2, but 3 is in the API. It's in Container.
Joined: Jun 01, 2009
Weird....I went to the API pages for container, jcomponent, etc. and did a find on getcomponentzorder. I'm using firefox so as I typed getcomponent it found the method getcomponent() but as soon as i typed 'z' firefox said there were no hits.
I followed your link and tried it again and this time it was found. Perhaps before I had not waited for the page to fully load?
Anyway, thanks for the reply, but does anyone know about 1) or 2)?
To find a methods parent class use the index link at the top of the javadoc, between "Deprecated" and "Help".
The idea about using zOrder was to change the draggingComponents zOrder to zero in mousePressed as it is selected, before you start dragging it. This will keep it on top of any other children while you drag it.