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.
Product Version: NetBeans IDE Dev (Build 200806260103) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Windows XP version 5.1 running on x86; Cp1250; sk_SK (nb) Create new JFrame (or JPanel) and set its Layout to Y-axis BoxLayout. Then add any component (e.g. JButton) by Drag&Drop. The container indicates placement location by yellow dashed line, but the final position of the element is different. (Suggested - top center, Real - top left). See attached pics. Note: It works this way only in case of the first element, other are indicated corretly.
Created attachment 63935 [details] Indicated position
Created attachment 63936 [details] Real position after placing
This is as designed in the following sense: we do not attempt to do an exact preview where the component will be placed. The only purpose of the indicated position is to let the user know between which components the new component will be dropped. Try to play with more components with different sizes - the indicated position is never exact, the size of the rectangle, for example, is different than the actual size of the component. As for your test case, the indicated position is painted as if the component had alignmentX property equal to 0.5 e.g. it is painted in the center. We don't consider the alignment property (or other - min, pref, max size properties of the component) because we don't want to indicate exact final location of the component, but its order among other components only. Leaving this issue as an enhancement request.
I see, thanks for explaining. And for leaving this issue "alive" as enhancement request (I take it as a sign that it was not a complete nonsense :) )