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.
Build: NetBeans IDE Dev (Build 200808061401) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.ClassCastException: javax.swing.JMenuItem cannot be cast to javax.swing.JMenu
Created attachment 66874 [details] stacktrace
I am sorry, I am not able to reproduce this issue and the attached exception is not sufficient to track the problem down. Are you still able to reproduce it? If so, could you, please, describe exact steps that lead to this exception? Thank you in advance.
I was using the Matisse editor in a Java desktop project. I attempted to graphically move a "menu item" from one menu to another and got the exception. It worked fine if I used the component inspector to move the menu items.
Thank you for your description, but we are still not able to reproduce it. My steps: - Create fresh new JDA Project - In main view in designer drag "Exit" menuitem from "File" menu and drop it into "Help" menu - Or add new menuitem from palette into "Help" menu and then move it from "Help" menu to "File" menu It works (NB IDE Dev Build 200808110201, JDK 1.6.0_05). Maybe there is someting wrong with your form. Can you please attach sources of your form (form and java file) or whole zipped project?
Build: NetBeans IDE Dev (Build 200808111401) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.ClassCastException: javax.swing.JMenuItem cannot be cast to javax.swing.JMenu at org.netbeans.modules.form.VisualReplicator.addToMenu(VisualReplicator.java:850) at org.netbeans.modules.form.VisualReplicator.addComponent(VisualReplicator.java:378) at org.netbeans.modules.form.VisualReplicator.updateAddedComponents(VisualReplicator.java:350) at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2266) at org.netbeans.modules.form.FormLAF$3.run(FormLAF.java:307) at org.openide.util.Mutex.doEventAccess(Mutex.java:1355)
Created attachment 67068 [details] stacktrace
I was able to duplicate the problem today with the latest build. I noticed that if I carefully dropped the menu item into the menu space below the menu that it worked fine. But, if I dropped the menu item onto the menu then I got the class cast exception.
reproducible on NetBeans IDE Dev (Build 20080804044921) detailed description: drag menuItem and move it on margin line between File and Help menu and try to drop it. Then ClassCastException is thrown
Fixed Modified file: http://hg.netbeans.org/main/rev/3ffeddec8d9e
Integrated into 'main-golden', available in build *200808260201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/3ffeddec8d9e User: Jiri Vagner <jvagner@netbeans.org> Log: #143248 - Fixed ClassCastException while moving menu items