This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Currently, right-clicking on a component that it inside a selected component does nothing, but IMHO the selection should change to the nested component. The current behaviour is inconsistent because if the parent was not selected, the selection DOES change to the nested component (and not to the parent). To be more specific, let's say there are two panels P1 and P2 (neither being inside the other) and one button B inside P1. Select P2. Right click on B -> Selection changes to B (ok) Select P2. Left click on B -> Selection changes to B (ok) Select P1. Left click on B -> Selection changes to B (ok) Select P1. Right click on B -> Selection does NOT change (P1 remains selected)
We can consider it... But the current behavior is intentional. It is consistent in that right-click does not change the selection if there is already something selected under mouse cursor. The main reason is that sometimes a subcomponent may occuppy the whole container, or it is not easy to select it - in which case it would hard/impossible to right-click the container. You can use TAB or Alt+Left click to select a component that can't be easily selected directly - then you might not want to change the selection by right click. Maybe we could detect those hard cases and let the righ-click selected the deepest component otherwise, whic I agree is more intuitive.
I think that you should consider also the frequency at which scenarios arise, and decide on that basis. A general and counter-intuitive (imho) inconsistency exists so that a very very specific situation can be covered: - A container with a single, completely covering component - The container is ALREADY selected somehow (either by Alt+click or using the bean inspector) - In this situation, the user wants to act on the container rather than on the component inside. I don't believe the above use case is so frequent as to justify the overall operation of the right click. IMHO it's much more frequent to right click on something in order to bring its context menu.
Fixed as suggested (together with issue 93049). Right click now selects like left click.