Separate class
In main program I have button whose actionperformed i want to write in separate class
JLabel label3 =new JLabel();
label3.setText("Added new RECORD to the DataBase");
String nam=txtA1.getText();
String num=txtA2.getText();
try
{
st2=con.createStatement();
String query="insert into dir1
values('"+num+"','"+nam+"')";
st2.executeUpdate(query);
st2.close();
}
catch(Exception e2)
{
label3.setText("Check that fields are not
empty.");
}
as the label3 and two text fields are common for main program and in this class . how to define it in this class?

