I was sick the day on our review for this programming assignment so I am in kind of a dillema with a jerk for a professor...What I am going to do is after each section show you guys what I have and I don't think I should have too many problems but would it be possible for feedback. If not thats ok I was just seeing if that is possible. This is what I have so far from completing section 2 and I think I got it done right just making sure.....

//packages to import
import java.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel = new Panel();
	TextArea topDisplay[] = new TextArea[16];
		
	private Panel bottomPanel = new Panel();
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	
	private int start;
	private int stop;
	private int step;

	public Checkerboard()
	
	{





	}//end action listener
}//end class

this is my instructions:

This will incorporate arrays, for loops, and Frames all in one.

Create a panel containing an array of 16 TextArea components that change color to correspond with the start, stop, and step values entered by the user. Perform the following tasks to create the Checkerboard Array application shown below. When the user enters the start, stop, and step fields and then clicks the Go button, the results are also shown below.

1. Call your application Checkerboard.java
2. You will need the following variables… declare them as private:
a. 16 component TextArea array
b. a Panel to hold the array
c. 3 TextField components with length of 10
d. 3 int variables to receive the start, stop, and step values
e. 3 Labels to display the words Start, Stop, and Step
f. a Go button
g. a Clear button
h. a Panel to hold the 3 TextFields, 3 Labels, and the 2 Buttons
3. Create a constructor method to:
a. construct each of the components declared above and initializes the start, stop, and step variables to zero (when constructing the TextArea components, use the following parameters: null, 3, 5, 3)
b. set the Frame layout to BorderLayout
c. write a for loop to loop the array and set each of the 16 TextArea components in that array so they cannot be edited. In the same loop, set each of the TextArea components text to be 1 more than the index number. Also in this same loop, set the background of each of the TextArea components to white.
d. set the Panel for the TextArea components to GridLayout with 4 rows, 4 columns, and both gaps set to 10
e. set the Panel for the TextFields, Labels, and button to GridLayout with 3 rows, 3 columns, and both gaps set to 5
f. add the components to their respective Panels
g. make the buttons clickable
h. place the Panels in the Frame… put one in the NORTH and one in the CENTER
i. Enter the addWindowListener() method described in the chapter… this is the method that overrides the click of the X so it terminates the application
4. In your actionPerformed() method:
a. convert the data in your TextFields to int and store them in the variables declared above
b. write a loop that goes through the array setting every background color to blue
c. write another loop that’s based on the user inputs. Each time the loop is executed, change the background color to yellow (so… start your loop at the user’s specified starting condition. You’ll stop at the user’s specified stopping value. You’ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)


5. Write a main() method that creates an instance of the Checkerboard Frame.
a. set the bounds for the frame to 50, 100, 300, 400
b. set the title bar caption to Checkerboard Array
c. use the setVisible() method to display the application Frame during execution
6. After you get all of this complete, include error handling to make sure:
a. the values entered in the TextFields are valid integers
b. the start value is greater than or equal to 1 and less than or equal to 16
c. the stop value is greater than or equal to 1 and less than or equal to 16
d. the step value is greater than or equal to 1 and less than or equal to 16
e. the start condition is less than the stop condition
f. when an error occurs, give an error message in a dialog box that is specific to their error, remove the text from the invalid field, and put the cursor in that field so the user has a chance to re-enter… this can be accomplished by using multiple try/catch statements
g. only change the colors if the numbers are valid
7. Create a clear button as seen in the example below. This button should:
a. clear out all 3 TextFields
b. change the background color of all TextArea array elements to white
c. put the cursor in the start field

Well I have to admit I usually use swing components rather than awt components for my GUIs. Has your instructor specifically asked you to use awt components? Changing to swing is easy - import javax.swing.* and add a J to the front of each of your GUI components. Other than that, looks like number 2 is done for you...

Really got a lot done today...I finished up with constructor, main, and clear button and just trying to verify everything is right. Also I am getting one error and I am sure it is something minor just having a hard time trying to figure out what it is so could anyone if they have time look at what I have along with the instructions and just make sure I have everything done right with the exception of action performed and the error I am getting is...

H:\JAVA\Checkerboard.java:102: cannot resolve symbol
symbol : method setSize (int,int,int,int)
location: class Checkerboard
f.setSize(50, 100, 300, 400);
^
code is:

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextField topDisplay;
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton[];
	private Button clearButton[];
	private boolean clearText;
	private boolean first;

	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct components and initialize beginning values
		topDisplay = new TextField(16);
		topDisplay.setEditable(false);
		topPanel = new Panel();
		bottomPanel = new Panel();
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);

		//set color to the panel
		//row 1
		for(int i = 1; i <= 4; i++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int i = 5; i <= 8; i++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int i = 9; i <= 12; i++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int i = 13; i <= 16; i++)
		//set color for
		setBackground(Color.white);

		//register the listener with each Button
		for(int i = 0; i < goButton.length; i++)
		goButton[i].addActionListener(this);

		for(int i = 0; i < clearButton.length; i++)
		clearButton[i].addActionListener(this);

		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setSize(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();
			
		} //end the if clear

	}//end action listener
}//end class

You just used the wrong method call for the Frame sizing - easy to fix. setSize() will take either a (width,height) or a Dimension argument. There is another method setBounds() that takes (x,y,width,height), which is probably the one you are trying to use.

commented: As always your advice is good :) +1

yea that worked fine...one other quick question...i tried to run my code and it will not let me but compiled fine...is there something I did wrong with my code or something that I just have not programmed yet because it looks fine on my end...

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextField topDisplay;
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton[];
	private Button clearButton[];
	private boolean clearText;
	private boolean first;

	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct components and initialize beginning values
		topDisplay = new TextField(16);
		topDisplay.setEditable(false);
		topPanel = new Panel();
		bottomPanel = new Panel();
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);

		//set color to the panel
		//row 1
		for(int i = 1; i <= 4; i++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int i = 5; i <= 8; i++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int i = 9; i <= 12; i++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int i = 13; i <= 16; i++)
		//set color for
		setBackground(Color.white);

		//register the listener with each Button
		for(int i = 0; i < goButton.length; i++)
		goButton[i].addActionListener(this);

		for(int i = 0; i < clearButton.length; i++)
		clearButton[i].addActionListener(this);

		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener
}//end class

yea that worked fine...one other quick question...i tried to run my code and it will not let me but compiled fine...is there something I did wrong with my code or something that I just have not programmed yet because it looks fine on my end...

What error message do you get when you try to run the program?

The null pointer error (with line number noted) indicates this is the problem

topPanel.setLayout(new GridLayout(4, 4, 10, 10));

NullPointerException indicates you tried to call a method or access a variable on an object reference that has not been initialized (it's still null). Your initialization of "topPanel" occurs 6 lines below that code, so the solution should be apparent.

"I was sick the day on our review for this programming assignment so I am in kind of a dillema with a jerk for a professor..."

Bad attitude. You're "professor" (more likely a highschool teacher if that) is no jerk. You're mistaken if you think he's going to allow you to fall behind on your studies and give you full marks for homework not done and material not studied just because you had a headache the night before.

This is the error I am getting in the command line console.....

Exception in thread "main" java.lang.NullPointerException
at Checkerboard.<init><Checkerboard.java:39>
at Checkerboard.main<Checkerboard.java:100>
Press any key to continue

my code is:

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextField topDisplay;
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton[];
	private Button clearButton[];
	private boolean clearText;
	private boolean first;

	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct components and initialize beginning values
		topDisplay = new TextField(16);
		topDisplay.setEditable(false);
		topPanel = new Panel();
		bottomPanel = new Panel();
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);

		//set color to the panel
		//row 1
		for(int i = 1; i <= 4; i++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int i = 5; i <= 8; i++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int i = 9; i <= 12; i++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int i = 13; i <= 16; i++)
		//set color for
		setBackground(Color.white);

		//register the listener with each Button
		for(int i = 0; i < goButton.length; i++)
		goButton[i].addActionListener(this);

		for(int i = 0; i < clearButton.length; i++)
		clearButton[i].addActionListener(this);

		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener
}//end class

I already explained the reason for that error - you have not yet initialized your panels when you call

topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

The code that creates those panels is several lines below those calls

topPanel = new Panel();
		bottomPanel = new Panel();

Ezzarel you dont havta reply to this prolly think I am the biggest idiot living but I still am having problems with this program...I tried movin a bench of stuff around but just went back to this w\some minor changes and still havin problems

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton[];
	private Button clearButton[];
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		clearText = true;

		//construct the Display
		for(int i = 1; i <= 16; i++)
		{
			topDisplay[i] = new TextArea(null,3,5,3);
		}

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);

		//set color to the panel
		//row 1
		for(int i = 1; i <= 4; i++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int i = 5; i <= 8; i++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int i = 9; i <= 12; i++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int i = 13; i <= 16; i++)
		//set color for
		setBackground(Color.white);

		//register the listener with each Button
		for(int i = 0; i < goButton.length; i++)
		goButton[i].addActionListener(this);

		for(int i = 0; i < clearButton.length; i++)
		clearButton[i].addActionListener(this);

		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener
}//end class
commented: insulting people who try to help you just makes you look like such an idiot -3
commented: I think they misunderstood what you were saying here. I didn't read it as an insult. +7

you really think that insulting people who try to help you is going to make them more likely to do your homework for you?
If so, think again...

Or don't you think at all before posting such crap?

First of all, can someone explain to me what he said?:

Ezzarel you dont havta reply to this prolly think I am the biggest idiot living but I still am having problems with this program...I tried movin a bench of stuff around but just went back to this w\some minor changes and still havin problems

Because my English are not that good

And it seems to me that Ezzarel has told you the solution. If you don't understand it then learn basic java and don't stuff like gui

idiot kid is too lazy to do its own homework and wants us to do it for it.
That and/or it's utterly incapable of understanding what it's being told.
I vote for both of those at the same time.

keep your whining to yourself. Look I even talked with him about it and I was not calling him an idiot. He already helped me and I clearly said anyone but him only because I did not want to keep bothering him since he had done such a great job explaining my errors to me.

I think I made the correct changes by moving things around and initializing the buttons and panels (as long as I did it correctly) and getting a new message that I think has something to do with the TextArea. If this is just something with the action event then I am not worried about it because I am programming that today but if I am still messing something up with initialization point any ideas would be helpful.

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{

		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];

		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//construct the Display
		for(int i = 1; i <= 16; i++)
			{
				topDisplay[i] = new TextArea(null,3,5,3);
			}

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);

		//set color to the panel
		//row 1
		for(int i = 1; i <= 4; i++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int i = 5; i <= 8; i++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int i = 9; i <= 12; i++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int i = 13; i <= 16; i++)
		//set color for
		setBackground(Color.white);



		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener
}//end class

Error in the console application says:

Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:625)
at java.awt.Container.add(Container.java:307)
at Checkerboard.<init>(Checkerboard.java:52)
at Checkerboard.main(Checkerboard.java:110)
Press any key to continue . . .

Could importing another java package resolve this

bottomPanel.add(goButton);

Where do you do: goButton = new Button("some name"); ? If you don't do this then goButton is null.

Obviously you must initialize everything before you use it. And the compiler will tell you the lines where you try to use null objects

so the lazy idiot kid has fallen into the normal pattern of the homework kiddo and started getting abusive.
How surprising, NOT.

You're going to make a lot of friends with that attitude, kiddo. It's really going to help you bully your way into friendships.

Ok I just wanna apologize to anyone I offended even the guy from the netherlands. I am not asking for someone to do my homework. These programming classes are the last 2 I have...one is java and the other is C++. I do not want to go into programming because I will be the first to admit I am completely horrible at it. I also do not want it to be called lazy because lazy is not caring and wanting someone to do it for me word for word and I do not want that. I have been working on this program all week and to me a forum is the last resolution for me if I am unable to resolve a problem because you guys especially in this forum have been really helpful for me to understand the material even the guy from the Netherlands.

With that being said I think I have gotten really close because I have gotten my program to run...the only problem is I only can see 3 boxes (they are not even numbered), 3 labels (start, stop,and step), and two giant sized buttons(go and clear)

I really hope this is just something small and could easily be corrected but does anyone see the error I am making in my program. I wanna think it has something to do with my program being out of order but I tried moving a bunch of things around and couldnt come across any changes.

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{

		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];

		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 1; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);






		//set color to the panel
		//row 1
		for(int x = 1; x <= 4; x++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int x = 5; x <= 8; x++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int x = 9; x <= 12; x++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int x = 13; x <= 16; x++)
		//set color for
		setBackground(Color.white);
	}



		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowclosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//convert data in TextField to int
		int start = Integer.parseInt(startField.getText());
		int stop = Integer.parseInt(stopField.getText());
		int step = Integer.parseInt(stepField.getText());

		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			start = 0;
			stop = 0;
			step = 0;
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener

}//end class

FINALLY got what I needed to be done today now just working on the action...was wondering if anyone had a chance to take a look at what I have done so far to make sure everything looks good and was also wanting to know if anyone had an idea on how to put numbers on the boxes...

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{

		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];

		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 0; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);
				topPanel.add(topDisplay[i]);







		//set color to the panel
		//row 1
		for(int x = 1; x <= 4; x++)
		//set color for
		setBackground(Color.white);

		//row 2
		for(int x = 5; x <= 8; x++)
		//set color for
		setBackground(Color.white);

		//row 3
		for(int x = 9; x <= 12; x++)
		//set color for
		setBackground(Color.white);

		//row 4
		for(int x = 13; x <= 16; x++)
		//set color for
		setBackground(Color.white);
	}



		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowClosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//convert data in TextField to int
		int start = Integer.parseInt(startField.getText());
		int stop = Integer.parseInt(stopField.getText());
		int step = Integer.parseInt(stepField.getText());

		for(int i = 1; i <=16; i++)
		setBackground(Color.blue);

		for(int i = start; i <= stop; i++)
		setBackground(Color.yellow);

		//test clear
		String arg = e.getActionCommand();

		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			startField.setText("");
			stopField.setText("");
			stepField.setText("");
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener

}//end class

apologize for bothering you guys but I have one more question and no more bothering I promise...

It has to do with my go button...When I click it, the background turns to blue that is no problem but the issue is certain parts do not return to yellow...It is hard to explain withpout showing the instuctions so here are the instructions for the for loop

write another loop that’s based on the user inputs. Each time the loop is executed, change the background color to yellow (so… start your loop at the user’s specified starting condition. You’ll stop at the user’s specified stopping value. You’ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)

In the start stop and step fields in the example I have on my word document there shows 16 boxes looking like this

1 2 3 4
5 6 7 9
9 10 11 12
13 14 15 16

When I input 3 for start 15 for stop and 4 for step the boxes that are to be yellow are 3, 7, 11, 15...however they are all turning blue and was wondering if anyone could take a look at my loop and let me know if I am doing something wrong in it or something else.

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;

public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{

		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];


		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 0; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);
				topDisplay[i].setText(String.valueOf(i+1));
				topDisplay[i].setEditable(false);
				topPanel.add(topDisplay[i]);
				//topPanel.setEditable("false");
			}

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowClosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);

	}

	public static void main(String args[])
	{
		Checkerboard f = new Checkerboard();
		f.setTitle("Checkerboard Array");
		f.setBounds(50, 100, 300, 400);
		f.setLocationRelativeTo(null);
		f.setVisible(true);

	} //end main

	public void actionPerformed(ActionEvent e)
	{
		//convert data in TextField to int
		int start = Integer.parseInt(startField.getText());
		int stop = Integer.parseInt(stopField.getText());
		int step = Integer.parseInt(stepField.getText());

		//test go
		String arg = e.getActionCommand();

		//go button was clicked
		if(arg.equals("Go"))
		{

			for(int i = 0; i <=16; i++)
			topDisplay[i].setBackground(Color.blue);

			for(int i = start; i <= stop; step++)
			topDisplay[i].setBackground(Color.yellow);

		} //end the if go



		//clear button was clicked
		if(arg.equals("Clear"))
		{
			clearText = true;
			startField.setText("");
			stopField.setText("");
			stepField.setText("");
			first = true;
			setBackground(Color.white);
			startField.requestFocus();

		} //end the if clear

	}//end action listener

}//end class

I can try explaining it better if noone understands what I mean

Jim you need to pay close attention to your run-time errors. You have a problem here:

for(int i = 0; i <=16; i++)
			topDisplay[i].setBackground(Color.blue);

			for(int i = start; i <= stop; step++)
			topDisplay[i].setBackground(Color.yellow);

You have two loops. Don't assume the problem is in the second one. Look closely at the numbers in the first loop, and look closely at the instructions regarding array indexes give by your teacher (see bold):

write another loop that’s based on the user inputs. Each time the loop is executed, change the background color to yellow (so… start your loop at the user’s specified starting condition. You’ll stop at the user’s specified stopping value. You’ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)

Also, did you get something like this?

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 16
        at Checkerboard.actionPerformed(Checkerboard.java:117)

You need to read these error messages carefully. They'll tell you exactly what the problem is and where it is usually.

got the yellow boxes to come up but just one box.....so is there something wrong with my yellow set background because I am not seeing any more errors

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;


public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];


		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 0; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);
				topDisplay[i].setText(String.valueOf(i+1));
				topDisplay[i].setEditable(false);
				topPanel.add(topDisplay[i]);
			}

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowClosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);
		}

		public static void main(String args[])
			{
				Checkerboard f = new Checkerboard();
				f.setTitle("Checkerboard Array");
				f.setBounds(50, 100, 300, 400);
				f.setLocationRelativeTo(null);
				f.setVisible(true);
			} //end main

			public void actionPerformed(ActionEvent e)
			{
				boolean done = false;

				//test go
				String arg = e.getActionCommand();

				//go button was clicked
				if(arg.equals("Go"))
					{
			//convert data in TextField to int
			int start = Integer.parseInt(startField.getText());
			int stop = Integer.parseInt(stopField.getText());
			int step = Integer.parseInt(stepField.getText());

			while(!done)
			{
				try
				{
					if((start <= 1) && (start > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					startField.setText(" ");
					startField.requestFocus();
				} //end catch
				try
				{
					if ((stop < 1) && (stop > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					stopField.setText(" ");
					stopField.requestFocus();
				} //end catch
				try
				{
					if ((step < 1) && (step > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					stepField.setText(" ");
					stepField.requestFocus();
				} //end catch
				try
				{
					if (start > stop) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
					startField.setText(" ");
					stopField.setText(" ");
					stepField.setText(" ");
					startField.requestFocus();
				} //end catch
		} //end while

				for(int i = 0; i <=15; i++)
				topDisplay[i].setBackground(Color.blue);

				for(int i = start; i <= stop; step++)
				topDisplay[i].setBackground(Color.yellow);
			} //end the if go

			//clear button was clicked
			if(arg.equals("Clear"))
			{
				clearText = true;
				startField.setText("");
				stopField.setText("");
				stepField.setText("");
				first = true;
				setBackground(Color.white);
				startField.requestFocus();

			} //end the if clear
	}//end action listener
}//end class

Almost finished just working on my try\catch and I will be done can anyone let me know if I am on the right track and if I am any advice id greatly appreciate it if its before 11?

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;


public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];


		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 0; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);
				topDisplay[i].setText(String.valueOf(i+1));
				topDisplay[i].setEditable(false);
				topPanel.add(topDisplay[i]);
			}

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowClosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);
		}

		public static void main(String args[])
			{
				Checkerboard f = new Checkerboard();
				f.setTitle("Checkerboard Array");
				f.setBounds(50, 100, 300, 400);
				f.setLocationRelativeTo(null);
				f.setVisible(true);
			} //end main

			public void actionPerformed(ActionEvent e)
			{
				boolean done = false;

				//test go
				String arg = e.getActionCommand();

				//go button was clicked
				if(arg.equals("Go"))
					{
			//convert data in TextField to int
			int start = Integer.parseInt(startField.getText());
			int stop = Integer.parseInt(stopField.getText());
			int step = Integer.parseInt(stepField.getText());

			while(!done)
			{
				try
				{
					if((start <= 1) && (start > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					startField.setText(" ");
					startField.requestFocus();
				} //end catch
				try
				{
					if ((stop < 1) && (stop > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					stopField.setText(" ");
					stopField.requestFocus();
				} //end catch
				try
				{
					if ((step < 1) && (step > 16)) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
					stepField.setText(" ");
					stepField.requestFocus();
				} //end catch
				try
				{
					if (start > stop) throw new NumberFormatException();
					else done = true;
				} //end try
				catch (NumberFormatException f)
				{
					JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
					startField.setText(" ");
					stopField.setText(" ");
					stepField.setText(" ");
					startField.requestFocus();
				} //end catch
		} //end while

				for(int i = 0; i <=15; i++)
				topDisplay[i].setBackground(Color.blue);

				for(int i = start-1; i < stop; i+=step)
				topDisplay[i].setBackground(Color.yellow);
			} //end the if go

			//clear button was clicked
			if(arg.equals("Clear"))
			{
				clearText = true;
				startField.setText("");
				stopField.setText("");
				stepField.setText("");
				first = true;
				setBackground(Color.white);
				startField.requestFocus();

			} //end the if clear
	}//end action listener
}//end class

last question and I will be done this is the problem I am having and not sure how to do this.....

only change the colors if the numbers are valid

//packages to import
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;


public class Checkerboard extends Frame implements ActionListener
{
	private Panel topPanel;
	private TextArea topDisplay[];
	private Panel bottomPanel;
	private TextField startField = new TextField(10);
	private TextField stopField = new TextField(10);
	private TextField stepField = new TextField(10);
	private Label startLabel = new Label ("Start");
	private Label stopLabel = new Label ("Stop");
	private Label stepLabel = new Label ("Step");
	private Button goButton;
	private Button clearButton;
	private boolean clearText;
	private boolean first;
	private int start;
	private int stop;
	private int step;

	//constructor methods
	public Checkerboard()

	{
		//construct components and initialize beginning values
		topPanel = new Panel();
		topDisplay = new TextArea[16];


		goButton = new Button("Go");
		clearButton = new Button("Clear");
		first = true;
		bottomPanel = new Panel();
		int start = 0;
		int stop = 0;
		int step = 0;
		bottomPanel.add(startField);
		bottomPanel.add(stopField);
		bottomPanel.add(stepField);
		bottomPanel.add(startLabel);
		bottomPanel.add(stopLabel);
		bottomPanel.add(stepLabel);
		bottomPanel.add(goButton);
		goButton.addActionListener(this);
		bottomPanel.add(clearButton);
		clearButton.addActionListener(this);
		clearText = true;

		//set layouts for the Frame and Panels
		setLayout(new BorderLayout());
		topPanel.setLayout(new GridLayout(4, 4, 10, 10));
		bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));

		//construct the Display
		for(int i = 0; i <= 15; i++)
			{
				topDisplay[i] = new TextArea(null, 3, 5, 3);
				topDisplay[i].setText(String.valueOf(i+1));
				topDisplay[i].setEditable(false);
				topPanel.add(topDisplay[i]);
			}

		//add components to frame
		add(topPanel, BorderLayout.NORTH);
		add(bottomPanel, BorderLayout.CENTER);


		//allow the x to close the application
		addWindowListener(new WindowAdapter()
			{
				public void windowClosing(WindowEvent e)
					{
						System.exit(0);
					}
			} //end window adapter
			);
		}

		public static void main(String args[])
		{
			Checkerboard f = new Checkerboard();
			f.setTitle("Checkerboard Array");
			f.setBounds(50, 100, 300, 400);
			f.setLocationRelativeTo(null);
			f.setVisible(true);
		} //end main

		public void actionPerformed(ActionEvent e)
		{
			boolean done = false;

			//test go
			String arg = e.getActionCommand();

			//go button was clicked
			if(arg.equals("Go"))
			{
				//convert data in TextField to int
				int start = Integer.parseInt(startField.getText());
				int stop = Integer.parseInt(stopField.getText());
				int step = Integer.parseInt(stepField.getText());

				while(!done)
				{
					try
					{
						if((start <= 1) || (start > 16)) throw new NumberFormatException();
						else done = true;
					} //end try
					catch (NumberFormatException f)
						{
						JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
						startField.setText(" ");
						startField.requestFocus();
						} //end catch
						try
						{
							if ((stop < 1) || (stop > 16)) throw new NumberFormatException();
							else done = true;
							} //end try
							catch (NumberFormatException f)
							{
								JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
								stopField.setText(" ");
								stopField.requestFocus();
							} //end catch
							try
							{
								if ((step < 1) || (step > 16)) throw new NumberFormatException();
								else done = true;
							} //end try
							catch (NumberFormatException f)
							{
								JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
								stepField.setText(" ");
								stepField.requestFocus();
							} //end catch
							try
							{
								if (start > stop) throw new NumberFormatException();
								else done = true;
							} //end try
							catch (NumberFormatException f)
							{
								JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
								startField.setText(" ");
								stopField.setText(" ");
								stepField.setText(" ");
								startField.requestFocus();
							} //end catch
						} //end while

						for(int i = 0; i <=15; i++)
						topDisplay[i].setBackground(Color.blue);

						for(int i = start-1; i < stop; i+=step)
						topDisplay[i].setBackground(Color.yellow);
					} //end the if go

					//clear button was clicked
					if(arg.equals("Clear"))
					{
						clearText = true;
						startField.setText("");
						stopField.setText("");
						stepField.setText("");
						first = true;
						setBackground(Color.white);
						startField.requestFocus();
					} //end the if clear
				}//end action listener
			}//end class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.