I can not program a jFrame button

0

Every time I double-click the button to open his ActionPerformed, NETbeans creates it in the middle of another ActionPerformade of another button. Initial code:

privatevoidjButton1ActionPerformed(java.awt.event.ActionEventevt){//TODOaddyourhandlingcodehere:if(jTable.getSelectedRow()>-1){jComboBox1.removeAllItems();suamae.forEach((nana)->{jComboBox1.addItem(nana);});String[]isso=newString[4];for(intsim=0;sim<4;sim++){isso[sim]=jTable.getValueAt(jTable.getSelectedRow(),sim).toString();}jTextField1.setText(isso[0]);jComboBox2.setSelectedItem(isso[1]);jComboBox1.setSelectedItem(isso[2]);jPanel1.setVisible(true);}else{JOptionPane.showMessageDialog(this,"Você não cadastrou animais");
    }}

After double clicking on the new button to change your code:

privatevoidjButton1ActionPerformed(java.awt.event.ActionEventevt){//TODOaddyourhandlingcodehere:if(jTable.getSelectedRow()>-1){jComboBox1.removeAllItems();suamae.forEach((nana)->{jComboBox1.addItem(nana);});String[]isso=newString[4];for(intsim=0;sim<4;sim++){isso[sim]=jTable.getValueAt(jTable.getSelectedRow(),sim).toString();}jTextField1.setText(isso[0]);jComboBox2.setSelectedItem(isso[1]);jComboBox1.setSelectedItem(isso[2]);jPanel1.setVisible(true);}privatevoidjButton2ActionPerformed(java.awt.event.ActionEventevt){//TODOaddyourhandlingcodehere:}else{JOptionPane.showMessageDialog(this,"Você não cadastrou animais");
    }}

I have tried to change the name of the button, restart netbeans, take the Else and return it to the place, but nothing is right. All error code after doing this.

Does anyone know what I can do?

Do not call the variable name kkkkk

    
asked by anonymous 19.05.2018 / 18:39

0 answers