by andrednasoftware » Wed Aug 17, 2011 5:41 am
Thanks for the reply.
The example above is very interesting and serves as the basis for several projects, however, with the problem using NetBeans (Matisse), is that it generates code that organizes components (JTextField, JComboBox, etc) depending on the chosen layout (BorderLayout, GroupLayout, etc.). In the example of using DefaultOverlayble, notes that instantiation depends on the actualComponent and overlayComponent instantiation, and then add the DefaultOverlayble in a Container. It is not possible using Matisse.
Another possibility is to drag the DefaultIOverlayble component from the palette to design area, since it extends the JPanel component, and then add the actualComponent dragging it into the DefaultOverlayble, but a NullPointerException is thrown in overridden method setBounds() of DefaultOverlayble. Following is the StackTrace:
java.lang.NullPointerException
at com.jidesoft.swing.DefaultOverlayable.setBounds(Unknown Source)
at org.jdesktop.layout.GroupLayout$ComponentInfo.setBounds(Unknown Source)
at org.jdesktop.layout.GroupLayout.layoutContainer(Unknown Source)
at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:203)
at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.setupContainerLayout(SwingLayoutBuilder.java:110)
[catch] at org.netbeans.modules.form.VisualReplicator.setupContainerLayout(VisualReplicator.java:819)
at org.netbeans.modules.form.VisualReplicator.updateContainerLayout(VisualReplicator.java:329)
at org.netbeans.modules.form.FormDesigner$LayoutMapper.rebuildLayout(FormDesigner.java:2262)
at org.netbeans.modules.form.layoutdesign.LayoutDesigner.updateCurrentState(LayoutDesigner.java:117)
at org.netbeans.modules.form.FormDesigner.updateComponentLayer(FormDesigner.java:585)
at org.netbeans.modules.form.FormDesigner.access$2000(FormDesigner.java:107)
at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2531)
at org.netbeans.modules.form.FormLAF$3.run(FormLAF.java:329)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
at org.openide.util.Mutex.readAccess(Mutex.java:271)
at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:312)
at org.netbeans.modules.form.FormDesigner$FormListener.processEvents(FormDesigner.java:2377)
at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:2343)
at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:1296)
at org.netbeans.modules.form.FormModel.fireEventBatch(FormModel.java:1269)
at org.netbeans.modules.form.FormModel.firePendingEvents(FormModel.java:1232)
at org.netbeans.modules.form.FormModel.access$000(FormModel.java:68)
at org.netbeans.modules.form.FormModel$2.run(FormModel.java:1212)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
What I need to know is whether it is possible to create the layout using Matisse, especially using the tool Free Design, which uses a GroupLayout, and after initComponents() replace the instances of components by DefaultOverlayble or is there another way to create the layout using the Matisse and then add the overlay function.