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.
To reproduce: 1. Create any Java Application Project 2. Create JPanel form 3. Add a JLabel 3. Open property sheet and select the JLabel's "foreground" property. 4. Click on "..." button to show the Color Chooser based custom editor panel dialog (supplied by the ColorEditor PropertyEdior). 5. Select different color (say red). The "foreground" property value cell in the property sheet still shows the original color. 6. Now minimize NetBeans and restore it or in some way obscure and show the "foreground" property value cell in the property sheet. 7. Now the "foreground" property value cell in the property sheet shows the color selected in the Color Chooser based custom editor panel dialog which the user has not commited yet. I think the reason for this is that the property sheet is implemented as a JTable and the property value cell is implemented as a cell renderer. The cell renderer paints itself whenever it is obscured and shown. In case of ColorEditor PropertyEditor the renderer delegates the painting to paintValue() method of PropertyEditor which has the uncommited value from Color Chooser. This only happens when the user somehow makes the property value cell to repaint and is misleading. Once the Color Chooser dialog is hidden (by click on Ok or Cancel button) the value in the property value cell does revert to the correct value. I think the property sheet should cache the property value rather than the trasient value being edited. The value in the cell should be updated only when the user click OK. It could be considered a bug in the PropertyEditor - that it paints the transient value instead of property value.
Same problem occurs for "border", "font" and some other properties. I think the underlying reason is the same.
this is a problem of the FormPropertyEditor in form designer module, not a property sheet issue (e.g. package name property editor works fine)
Thanks for evaluation Stando. "Finishing" reassigning.
I think it is not a problem of FormPropertyEditor (it just wraps the enclosed property editor). You can see the same behavior when editing a color property anywhere in the IDE, not just in form editor. It is not a problem of ColorEditor either - it is just a lack of JavaBeans spec - the custom editor (visual component) has no clue about the Ok/Cancel flow, it needs to set the value to PropertyEditor whenever it is changed (e.g. a color selected). A fix in property sheet might be to create another instance of property editor for editing using custom editor. But I'm not sure if this would not cause some other problems. Overall not sure if this bug is worth fixing...
i agree with tpavek's evaluation. fixing this bug may break some other code that depends on this behavior. decreasing priority to P4
a lot of changes in property sheet needed for this fix. imho not worth the effort
NetBeans.org Migration: changing resolution from LATER to WONTFIX