Hey guys, for my computer science class we are writing with GUI
This is the first program I've tried to write with GUI and I can't figure these errors out.
thanks in advance.
piGUI.java:11: cannot resolve symbol
symbol : variable iteration
location: class piGUI
private double extent = iteration.getnumber();
^
piGUI.java:38: cannot resolve symbol
symbol : variable end
location: class piGUI
private double answer = numberField.setnumber(end);
^
import javax.swing.*; import BreezySwing.*; public class piGUI extends GBFrame{ private JLabel iterationLabel; private JLabel numberLabel; private DoubleField iterationField; private DoubleField numberField; private JButton iterationButton; private JButton numberButton; private double extent = iteration.getnumber(); public piGUI(){ iterationLabel = addLabel ("Iterations" ,1,1,1,1); numberLabel = addLabel ("Pi" ,1,2,1,1); iterationField = addDoubleField (0.0 ,2,1,1,1); numberField = addDoubleField (0.0 ,2,2,1,1); iterationButton = addButton (">>>>>" ,3,1,1,1);} public void buttonClicked (JButton buttonObj){ for (int i=1; i < extent; i++) { if(answer % 2 == 1) { extent=extent-1.0/(2*i-1); answer=answer+1; } else { extent=extent+1.0/(2*i-1); answer=answer+1; answer = answer * 4; } } } private double answer = numberField.setnumber(end); public static void main (String[] args){ piGUI theGUI = new piGUI(); theGUI.setSize (250, 100); theGUI.setVisible(true); } }