Hi guys

Task
Basic System Requirements (Graphical User Interface):
• 30 x 30 grid of JButton’s or Icon’s.
• 4 JButton’s for ‘Option 1-3’ and ‘Exit’.
• 3 JButton’s for ‘Act’, ‘Run’ and ‘Reset’.
• 9 JButton’s for ‘Forward >’, ‘Backwards <’, ‘Up ^’, ‘Down v’ should move the robot in the appropriate direction by one square for each press (plus 5 blank).
• The compass icon (JButton) should illustrate the current direction for the robot.
• 3 JLabel’s for’Option’, ‘Square’ and ‘Direction’.
• JTextField’s for the current option, location/square and direction of the robot. Use your own square identification method e.g 1 to 273 and N, E etc.
• Create a JFrame application, which opens to the set size (875 * 550).
• JFrame title set as "CBombRobot Application".

the robot moves in all directions, pushes the bomb, there is a red bricked area and compass which I have created code for, however i cant seem to figure out this section: create 3 JLabel’s for’Option’, ‘Square’ and ‘Direction’, & JTextField’s for the current option, location/square and direction of the robot

anyone happen happen to have the completed code for this section or know?: 3 JLabel’s for’Option’, ‘Square’ and ‘Direction’, & JTextField’s for the current option, location/square and direction of the robot


her is my code:
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.*; //allows access to java.awt.*
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.ImageObserver;
import java.*;
import javax.swing.JTextField;

///////////////////////////////////////////////////////
import javax.swing.Timer ;
import javax.management.timer.*;
////////////////////////////////////////////////////
public class CBRobotLewisBC extends JFrame implements ActionListener
{

private JPanel jForNavigationPanel;
private JPanel jForNavigationPane;
private JPanel jPNorthEast;
private JPanel jpLewisrobotarea;

private JButton jBLeft;
private JButton jButtonUp;
private JButton jBDown;
private JButton jBRight;
private JButton []jBareaRobot = new JButton[273];
private JPanel southpanel, navigationPanel, jPEast;
private JButton jEastButton, jWestButton, jNorthButton,jSouthButton, jCentreButton, jBlankButton;
private JButton jBTheoption1,jBThe_option2,jBThe_option3,jBThe_option4;
private JButton jBThe_compassButton;
private JPanel jPOptionsPanel;
private JPanel jPtoHoldOptionButtons;
private JTextField jTFWhich_Direction1;



int robotIndexPosistion;







public static void main(String[] args) {
CBRobotLewisBC frame = new CBRobotLewisBC();
frame.setSize(875, 550);
frame.createGround();
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setIconImage((new ImageIcon("bin/robot.jpg")).getImage());
frame.setVisible (true);



}



public void createGround()
{
Container window = getContentPane();
window.setLayout(new BorderLayout());

//------------- Ground Panel ------------------------
//Creates the jpGround Panel
jpLewisrobotarea = new JPanel();
jpLewisrobotarea.setPreferredSize(new Dimension(700, 416));
jpLewisrobotarea.setLayout(new GridLayout (13,21));
window.add(jpLewisrobotarea,BorderLayout.CENTER);







jPEast = new JPanel();//panel for

jPEast.setLayout( new BorderLayout());

jPEast.setPreferredSize(new Dimension(160,300));

window.add(jPEast, BorderLayout.EAST);


buildTheFloor();

jPNorthEast = new JPanel();//panel for
jPNorthEast.setLayout( new BorderLayout());
jPEast.add(jPNorthEast, BorderLayout.NORTH);



jForNavigationPanel = new JPanel();
jForNavigationPanel.setLayout( new GridLayout(3, 4));
jForNavigationPanel.setPreferredSize(new Dimension(275,100));




JButton jBlank = new JButton("");//BLANK BUTTON
jForNavigationPanel.add(jBlank );//1


jButtonUp = new JButton(" ^ ");
jButtonUp.addActionListener(this);
jForNavigationPanel.add(jButtonUp); //2



JButton jBlank2 = new JButton("");//BLANK BUTTON
jForNavigationPanel.add(jBlank2 );//3





jBLeft = new JButton(" < ");//4
jBLeft.addActionListener(this);
jForNavigationPanel.add(jBLeft);


JButton jBBlank3 = new JButton("");//BLANK BUTTON
jForNavigationPanel.add(jBBlank3 );//5



jBRight = new JButton(">");//6
jBRight.addActionListener(this);
jForNavigationPanel.add(jBRight);



JButton jBBlank4 = new JButton("");//BLANK BUTTON
jForNavigationPanel.add(jBBlank4 );//7



jBDown = new JButton(" v ");
jBDown.addActionListener(this);
jForNavigationPanel.add(jBDown);//8



JButton jBBlank5 = new JButton("");
jForNavigationPanel.add(jBBlank5 );//9
jPNorthEast.add(jForNavigationPanel, BorderLayout.SOUTH);
window.add(jPEast, BorderLayout.EAST);


jPtoHoldOptionButtons = new JPanel();
jPtoHoldOptionButtons.setLayout(new GridLayout(2, 2));
jPtoHoldOptionButtons.setPreferredSize(new Dimension(275, 100));





jPOptionsPanel = new JPanel();
jPOptionsPanel.setLayout(new BorderLayout());
jPOptionsPanel.add(jPtoHoldOptionButtons,BorderLayout.NORTH);
jPEast.add(jPOptionsPanel,BorderLayout.SOUTH);
The_Options();//Display Options
compass();
}



public void The_Options()
{
jBTheoption1 = new JButton("option 1");//8
jBTheoption1.addActionListener(this);
jPtoHoldOptionButtons.add(jBTheoption1);

jBThe_option2 = new JButton("option2");//8
jBThe_option2.addActionListener(this);
jPtoHoldOptionButtons.add(jBThe_option2);

jBThe_option3 = new JButton("option3");//8
jBThe_option3.addActionListener(this);
jPtoHoldOptionButtons.add(jBThe_option3);


jBThe_option4 = new JButton("EXIT");//8
jBThe_option4.addActionListener(this);
jPtoHoldOptionButtons.add(jBThe_option4);
}



public void compass()
{
JPanel jPcompass = new JPanel();
jBThe_compassButton = new JButton("");
jBThe_compassButton.setIcon(new ImageIcon(getClass().getResource("east.jpg")));
jBThe_compassButton.addActionListener(this);
jPcompass.add(jBThe_compassButton);
jPOptionsPanel.add(jPcompass, BorderLayout.SOUTH);

JPanel jPcompass2 = new JPanel();
jBThe_compassButton = new JButton("");
jBThe_compassButton.setIcon(new ImageIcon(getClass().getResource("north.jpg")));
jBThe_compassButton.addActionListener(this);
jPcompass2.add(jBThe_compassButton);
jPOptionsPanel.add(jPcompass, BorderLayout.SOUTH);

JPanel jPcompass3 = new JPanel();
jBThe_compassButton = new JButton("");
jBThe_compassButton.setIcon(new ImageIcon(getClass().getResource("west.jpg")));
jBThe_compassButton.addActionListener(this);
jPcompass3.add(jBThe_compassButton);
jPOptionsPanel.add(jPcompass, BorderLayout.SOUTH);

JPanel jPcompass4 = new JPanel();
jBThe_compassButton = new JButton("");
jBThe_compassButton.setIcon(new ImageIcon(getClass().getResource("south.jpg")));
jBThe_compassButton.addActionListener(this);
jPcompass4.add(jBThe_compassButton);
jPOptionsPanel.add(jPcompass, BorderLayout.SOUTH);


}


//Listen for event
public void actionPerformed(ActionEvent event)
{
Object source = event.getSource();



if (source == jBRight)
{


if (jBareaRobot[robotIndexPosistion + 1].getIcon().toString().endsWith("bomb32x32.png") == false)
{
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
robotIndexPosistion++;
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32.png")));



}
//If Bomb found move bomb
if (jBareaRobot[robotIndexPosistion + 1].getIcon().toString().endsWith("bomb32x32.png") == true)
{
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
robotIndexPosistion++;
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32.png")));
jBareaRobot[robotIndexPosistion + 1].setIcon(new ImageIcon(getClass().getResource("bomb32x32.png")));

}



}


if (source == jBLeft)
{
if(jBareaRobot[robotIndexPosistion-1].getIcon()!=jBareaRobot[101].getIcon())
{
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
robotIndexPosistion--;
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32Left.png")));
}
}



if (source == jButtonUp)
{
if(jBareaRobot[robotIndexPosistion-21].getIcon()!=jBareaRobot[101].getIcon())
{
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
robotIndexPosistion=robotIndexPosistion-21;
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32Up.png")));
}
}




if (source == jBDown)
{
if(jBareaRobot[robotIndexPosistion+21].getIcon()!=jBareaRobot[101].getIcon())
{
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
robotIndexPosistion=robotIndexPosistion+21;
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32Down.png")));
}
}




}














//creates Buttons for floor which adds to the frame
public void buildTheFloor()
{
robotIndexPosistion =189;
//Add Buttons";
for (int i=0; i<jBareaRobot.length; i++)

{
jBareaRobot[i] = new JButton("");
jBareaRobot[i].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
jBareaRobot[i].setBorderPainted(false);
jpLewisrobotarea.add(jBareaRobot[i]);

}
jBareaRobot[robotIndexPosistion].setIcon(new ImageIcon(getClass().getResource("robot32x32.png")));
//
jBareaRobot[0].setIcon(new ImageIcon(getClass().getResource("paper.jpg")));
jBareaRobot[32].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[53].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[74].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[95].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[116].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[137].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[158].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[179].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[200].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[90].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[111].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[132].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[153].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[174].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[195].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[216].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[237].setIcon(new ImageIcon(getClass().getResource("rock32x32.png")));
jBareaRobot[190].setIcon(new ImageIcon(getClass().getResource("bomb32x32.png")));
jBareaRobot[78].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[79].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[80].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[81].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[82].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[99].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[120].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[141].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[142].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[143].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[144].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[145].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[103].setIcon(new ImageIcon(getClass().getResource("bricks.png")));
jBareaRobot[124].setIcon(new ImageIcon(getClass().getResource("bricks.png")));



}

}

help would be greatly appreciated as i cant seem to figure this out and the deadline date is today @23.59