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.
When I click the preview viewer button on javafx editor, couldn't see any of the TextField components included in the .fx file. A portion of the message Log is below: uncaught FX exception: 'Component was null for Widget javafx.ui.TextField {row: javafx.ui.Row {alignment: javafx.ui.Alignment {name: \'BASELINE\' id: 3} resizable: false} column: javafx.ui.Column {alignment: javafx.ui.Alignment {name: \'LEADING\' id: 1} resizable: true} inBoundsListener: false focusListener: new FocusListener {}@15901789 null keyboardAction: [] component: null focusable: true focused: false onMouseEntered: null onMouseExited: null onMousePressed: null onMouseReleased: null onMouseClicked: null onMouseMoved: null onMouseDragged: null onMouseWheelMoved: null onKeyUp: null onKeyDown: null onKeyTyped: null propertyChangeListener: null textField: null verifier: null value: \'Joe\' text: \'\' columns: 25 editable: false enableDND: false horizontalAlignment: null selectOnFocus: false selectionStart: 0 selectionEnd: 0 inSelectionUpdate: false}' at throw "Component was null for Widget {w}"; ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/GroupLayout.fx", Line 116) at this.addColumns(panel, layout, hgroup) ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/GroupPanel.fx", Line 49) at frame.setContentPane(w.getComponent()) ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/Frame.fx", Line 303) at this.setContentPane(value) ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/Frame.fx", Line 298) at new Frame {content: new GroupPanel {var: firstNameRownew Row {alignment: BASELINE}, var: lastNameRownew Row {alignment: BASELINE}, var: labelsColumnnew Column {alignment: TRAILING}, var: fieldsColumnnew Column {alignment: LEADING, resizable: true}, rows: [firstNameRow, lastNameRow], columns: [labelsColumn, fieldsColumn], content: [new SimpleLabel {row: firstNameRow, column: labelsColumn, text: "First Name:"}, new TextField {row: firstNameRow, column: fieldsColumn, columns: 25, value: bind model.firstName}, new SimpleLabel {row: lastNameRow, column: labelsColumn, text: "Last Name:"}, new TextField {row: lastNameRow, column: fieldsColumn, columns: 25, value: bind model.lastName}]}, visible: true} ("javafx.netbeans", Line 17) at unit.execute() ("javafx.netbeans.preview", Line 70) at operation <<javafx.ui.GroupLayout>>.addColumns(this: GroupLayout, host: <<java.awt.Container>>, layout: <<org.jdesktop.layout.GroupLayout>>, hgroup: <<org.jdesktop.layout.GroupLayout$SequentialGroup>>) { if (columns == null and content.column == null) { columns = new Column {}; for (i in content) { i.column = columns[0]; } } for (i in columns) { var [pgroup = layout.createParallelGroup(i.alignment.id, i.resizable)]; hgroup.add(pgroup); var [comps : <<java.awt.Component>> = []]; for (j in content where j.column == i) { if (j instanceof <<javafx.ui.Widget>>) { var [w = (Widget)j]; var [c = w.getComponent()]; if (c == null) { throw "Component was null for Widget {w}"; } if (w.sizeToFitColumn) { insert c into comps; } if (j.horizontal <> null) { var [spring = j.horizontal]; pgroup.add(c, spring.min, spring.pref, spring.max); } else { if (i.resizable) { pgroup.add(c, 0, <<org.jdesktop.layout.GroupLayout>>.PREFERRED_SIZE, MAX_INT:Number); } else { pgroup.add(c, <<org.jdesktop.layout.GroupLayout>>.PREFERRED_SIZE, <<org.jdesktop.layout.GroupLayout>>.PREFERRED_SIZE, <<org.jdesktop.layout.GroupLayout>>.PREFERRED_SIZE); } } } else { if (j instanceof <<javafx.ui.Gap>>) { var [spring = j.horizontal]; pgroup.add(spring.min, spring.pref, spring.max); } else { if (j instanceof <<javafx.ui.GroupLayout>>) { var [g = (GroupLayout)j]; var [sg = layout.createSequentialGroup()]; g.addColumns(host, layout, sg); pgroup.add(i.alignment.id, sg); } } } } if (sizeof comps > 0) { layout.linkSize(comps, layout.HORIZONTAL); } } } ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/GroupLayout.fx", Line 100) at operation <<javafx.ui.GroupPanel>>.createComponent(this: GroupPanel): <<javax.swing.JComponent>> { panel = new <<javax.swing.JPanel>>; panel.setOpaque(false); layout = new <<org.jdesktop.layout.GroupLayout>>(panel); panel.setLayout(layout); layout.setAutocreateGaps(autoCreateGaps); layout.setAutocreateContainerGaps(autoCreateContainerGaps); var [hgroup = layout.createSequentialGroup()]; var [vgroup = layout.createSequentialGroup()]; this.addColumns(panel, layout, hgroup); this.addRows(panel, layout, vgroup); layout.setHorizontalGroup(hgroup); layout.setVerticalGroup(vgroup); return panel; } ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/GroupPanel.fx", Line 39) at operation <<javafx.ui.Widget>>.getComponent(this: Widget): <<javax.swing.JComponent>> { if (component == null) { var [comp = this.createComponent()]; var [c = comp]; if (c instanceof <<javax.swing.JScrollPane>>) { c = (<<javax.swing.JComponent>>)(<<javax.swing.JScrollPane>>)c.getViewport().getView(); } if (doubleBuffered <> null) { c.setDoubleBuffered(doubleBuffered); } if (cursor <> null) { c.setCursor(cursor.getCursor()); } if (toolTipText <> null) { c.setToolTipText(toolTipText); } if (visible <> null) { c.setVisible(visible); } if (opaque <> null) { c.setOpaque(opaque); } if (background <> null) { c.setBackground(background.getColor()); c.setOpaque(true); } if (foreground <> null) { c.setForeground(foreground.getColor()); } if (awtFont <> null) { c.setFont(awtFont); } if (focusable <> c.isFocusable()) { c.setFocusable(focusable); } var [self = this]; focusListener = new FocusListener {}; c.addFocusListener(focusListener); if (componentOrientation <> null) { c.setComponentOrientation(componentOrientation); } if (border <> null) { try { c.setBorder(border.getBorder()); } catch (e) { } } if (enabled <> null) { c.setEnabled(enabled); } if (size <> null) { c.setSize(size); } if (alignmentX <> null) { c.setAlignmentX(alignmentX); } if (preferredSize <> null) { var [dim = c.getPreferredSize()]; if (dim <> null) { if (preferredSize.height <= 0) { preferredSize.height = dim.height; } if (preferredSize.width <= 0) { preferredSize.width = dim.width; } } c.setPreferredSize(preferredSize); } if (alignmentY <> null) { c.setAlignmentY(alignmentY); } if (keyboardAction <> null) { var [inputMap = c.getInputMap()]; var [actionMap = c.getActionMap()]; for (i in keyboardAction) { var [k = i.keyStroke]; var [a = i.action]; var [j = JKeyStroke.getKeyStroke(k.id, 0)]; inputMap.put(j, i); actionMap.put(i, new Action {}); } } if (focusTraversalKeysEnabled <> null) { c.setFocusTraversalKeysEnabled(focusTraversalKeysEnabled); } if (keyListener <> null) { c.addKeyListener(keyListener); } if (mouseListener <> null) { c.addMouseListener(mouseListener); } if (mouseMotionListener <> null) { c.addMouseMotionListener(mouseMotionListener); } if (mouseWheelListener <> null) { c.addMouseWheelListener(mouseWheelListener); } if (x <> null or y <> null or height <> null or width <> null) { var [bounds = comp.getBounds()]; if (x <> null) { bounds.x = x; } if (y <> null) { bounds.y = y; } if (width <> null) { bounds.width = width; } if (height <> null) { bounds.height = height; } if (bounds.width == 0) { bounds.width = comp.getPreferredSize().width; } if (bounds.height == 0) { bounds.height = comp.getPreferredSize().height; } println("setting bounds to {bounds}"); comp.setBounds(bounds); } self.inBoundsListener = true; x = comp.getX(); y = comp.getY(); width = comp.getWidth(); height = comp.getHeight(); self.inBoundsListener = false; comp.addComponentListener(new ComponentListener {}); if (focused) { do later { requestFocus(); } } component = comp; } return component; } ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/Widget.fx", Line 376) at operation <<javafx.ui.Frame>>.setContentPane(this: Frame, w: Widget) { if (w <> null) { frame.setContentPane(w.getComponent()); frame.validate(); } } ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/Frame.fx", Line 301) at trigger on (Frame.content = value) { this.setContentPane(value); } ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/Frame.fx", Line 297) at new Canvas {content: bind compileContent()} ("javafx.netbeans.preview", Line 35) at __composite__ = this.composeWidget() ("jar:file:/home/leonux/Tools/IDE/netbeans/6.0m10/nb6.0/modules/ext/javafx/javafxrt.jar!/javafx/ui/CompositeWidget.fx", Line 22) at doc.renderPreview(new FXWidget {document: doc}.getComponent()) ("javafx.netbeans.preview", Line 106)
Created attachment 48264 [details] message.log
Could you please also attach the source code, which is causing this problem ?
Created attachment 48281 [details] Source code that show TextField using javafxpad but not in netbean 6.0
Created attachment 48283 [details] Source code using TextField that generate the error too, copied from https://openjfx.dev.java.net/Learning_More_About_JavaFX.html#grouppanel
Obsolete milestone, please reevaluate
Created attachment 49066 [details] Screen shot with working application.
In Beta1 version it works fine, marking as fixed. Available on Beta UC for Beta1. Please refer to https://openjfx.dev.java.net/javafx-nb60-plugin-install.html and http://wiki.netbeans.org/wiki/view/JavaFXPluginUserFAQ if you would like to try out Beta1 version.
verified