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.

Bug 204184 - Java Bean: setDoubleBuffered() Methods Not Copied When Form is Copied
Summary: Java Bean: setDoubleBuffered() Methods Not Copied When Form is Copied
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1
Hardware: PC Windows Vista
: P4 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 05:53 UTC by MackSix
Modified: 2011-10-25 13:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project that exhibits the error. (28.72 KB, application/zip)
2011-10-25 05:53 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2011-10-25 05:53:48 UTC
Created attachment 112386 [details]
Project that exhibits the error.

1) Create new Project
2) Create new JFrame Form. (i.e. MyJFrame.java)
3) Add all 7 JCalender Beans from http://www.toedter.com/en/jcalendar/
   JLocaleChooser
   JDayChooser
   JCalendar
   JDateChooser
   JMonthChooser
   JSpinField
   JYearChooser
4) Check doubleBuffered Properties for all 7 JCalendar components.
5) Copy JFrame Form using Refactoring.
6) Notice that 6 out of 7 setDoubleBuffered() Methods are missing in copy.

See attached project with JCalender Beans already included.
Comment 1 MackSix 2011-10-25 06:04:05 UTC
Product Version: NetBeans IDE Dev (Build 201110240600)
Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 2 Jan Stola 2011-10-25 12:51:58 UTC
In fact, it is not necessary to copy the form. It is sufficient to close it, reopen it and do some unrelated change that forces regeneration of the source code.

The resulting code (with only one setDoubleBuffered() method) is correct because the default value of doubleBuffered property of all the mentioned components (except JLocaleChooser) is true. Hence, only JLocaleChooser requires this statement to be generated.

On the other hand, the initial state is incorrect. When the other (i.e., not JLocalChooser) components are added then Properties window incorrectly shows that the default value of their doubleBuffered property is false.

This is caused by the lazy initialization of default values of the properties and by the fact that we set doubleBuffered property to false during painting of the component being added. We have to restore the original value of this property when the component is added.
Comment 3 Jan Stola 2011-10-25 13:46:48 UTC
Fixed.

Modified file: http://hg.netbeans.org/jet-main/rev/4de8f78971b5