Java - not supported yet error message

540 Views Asked by At

this is part of my code for one of my frames:

 public Details(String abc) {
    initComponents();
    jLabel5.setText(abc);
}

    //To change body of generated methods, choose Tools | Templates.

Details() {
     //To change body of generated methods, choose Tools | Templates.
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { 
try{
  Class.forName("java.sql.Driver");
  Connection con=(Connection) DriverManager.getConnection("jdbc:mysql://localhost/foodframe", "root", "valli99");
  Statement stmt=(Statement) con.createStatement();
  String query="Update user set Name='"+jTextField1.getText()+"', Age='"+age+"', Restrictions='"+Restriction+"', Dislikes_Allergies='"+jTextArea1.getText()+"' where Username='"+jLabel5.getText()+"';";
  stmt.executeUpdate(query);

rs.close();
stmt.close();
con.close();
    }
 catch(Exception e){
 JOptionPane.showMessageDialog(null, e.getMessage());
}
}

I'm facing 2 problems here.

  1. I'm not able to execute this frame. It gets compiled but doesn't run.

  2. However, it's accessible from my other frame (upon clicking a button on login frame, this frame opens up). Then, upon clicking the button in this frame, it generates an error message: "not supported yet"

I've removed the @param args comment and "throw new UnsupportedOperationException("Not supported yet."). It's still not working.

Please do help. Thanks.

0

There are 0 best solutions below