Hmm for some reason it says not a statement?
public class frmSubnet_Calculator extends javax.swing.JFrame {
private JTextField\[\] arrJTxtFldIntegerOctets;
/\*\* Creates new form frmSubnet\_Calculator \*/
public frmSubnet\_Calculator() {
initComponents();
// Center program on screen:
setLocationRelativeTo(null);
arrJTxtFldIntegerOctets = {jTxtFldIntegerOctet1, // error message starts here
jTxtFldIntegerOctet2,
jTxtFldIntegerOctet3,
jTxtFldIntegerOctet4,
jTxtFldIntegerOctet5,
jTxtFldIntegerOctet6,
jTxtFldIntegerOctet7,
jTxtFldIntegerOctet8
};
Nagy Vilmos wrote:
You could use the same line as you had befor:
public Class GuiForm extends JFrame {
// define the array as a member variable, uninitialised:
private JTextField[] arrJTxtFld;
public GuiForm() {
initComponents();
// now you can use the UI components
this.arrJTxtFld = {jTextField1, jTextField2, jTextField3};
}
}