class MyClass {
public static int com;
public static void Method()
{
com = GUI.num1 * GUI.num2;
GUI.TextBox3.setText(""+com);
}
}
And
private void Button1ActionPerformed(java.awt.event.ActionEvent evt) {
num1 = Integer.parseInt(TextBox1.getText());
num2 = Integer.parseInt(TexBox2.getText());
MyClass.Method();
}
This will be more Convenient.
Here
GUI.TextBox3.setText(com);
TextBox3
also needs to be static.
NOTE: You even don't need the class for calculation directly calculate
TextBox3.setText(""+(num1*num2));