Copying a JPanel to another container (by choosing "Copy" then "Paste")makes all the property's labels (or JButtons)
text within the JPanel to "null"
I am sorry, I am not able to reproduce this issue. Could you, please, provide more details? Is the target container in
the same form (in the same package)? Do you use automatic internationalization? Do you use swing application framework
(e.g. JSR 296)? It would be ideal to attach a simple test-case. Thank you in advance.
Here is a real test : i have two packages in the same level: "spherique" and "torique". in the "spherique" package,
i have a JDialog "CorrectionsUI" that contains a JPanel and other simple components
(JButtons, JLabels, JFormattedTextField and a JScrollPane/JTable).
I want to copy/paste this JDialog to the "torique" package. I have clicked in a first time the "copy" menu related to
the JDialog , then i have right clicked in a target package (torique) and choosen the second option of the the "Paste"
menu who is "Refactor Copy". I changed the original name to "CorrectionsTorUI" and after copy finished, i opened the
look at the picture to understand !
Do you use automatic internationalization? No
Do you use swing application framework? Yes
Created attachment 58852 [details]
A picture of the final result of the copy
This is actually a known problem - copy refactoring is not supported yet by the GUI builder (the necessary app framework
resources are not copied). See also http://wiki.netbeans.org/wiki/view/GUIBuilderRefactoring
As a workaround, you may try to create 'resources' subpackage under the target package and copy there manually the
.properties file of the original form. (I.e. in your case copy 'spherique/resources/CorrectionsUI.properties' to
*** This issue has been marked as a duplicate of 106831 ***
Reopening... to mark as fixed.
Support for copy refactoring implemented. The described test case should work now - application resources are copied
together with the form class.
reported use case used in JDA project is verified in build
Product Version: NetBeans IDE Dev (Build 20080618061212)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
note for bassim: be aware that icons are not correctly handled. If you manage icons from resources as well (is "ON" as
default in JDA project), they won't be copied together with form class and ResourceBundle to new package. See issue 105850
*** Issue 142691 has been marked as a duplicate of this issue. ***