-
addcomponenet error.
Code:
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(accountNumberField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
.addComponent(surnameField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
.addComponent(firstNameField, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE))))
.addContainerGap());
Why is there an error on the first addcomponent(jlabel3...
but the others that follow don't have an error?
This is the error i get
Code:
cannot find symbol
symbol : method addComponent(javax.swing.JLabel,javax.swing.GroupLayout.Alignment,int,int,short)
location: class javax.swing.GroupLayout.SequentialGroup
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
^
-
Have you tried to manually change the grouplayout-using code? Have you deleted the declaration of any variables (in particular jLabel3)? Myself, I try to use the other more user-friendly layouts and avoid using NetBeans-generated code. YMMV. Much luck!
-
Cross-posted here: New To Java - addcomponenet error.
Please read what JavaRanch says about cross-posting without being forthright about it: BeForthrightWhenCrossPostingToOtherSites
The same etiquette applies here and in the other programming fora.