hi please i deperately need help been trying to compile this code on netbeans IDE but it keeps giving me error on the output
code is:
package gameapplication;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
*
* @author beeumeh
*/
class Selection2 extends JFrame implements ActionListener {
private JLabel label1, label2, label3, label4, label5, label6, label7,
label8;
private JButton button1;
private String PlayersNos;
private JCheckBox team1, team2, team3, team4, team5, team6;
private JPanel panel1, panel2, panel3, panel4, panel5, panel6, panel7;
private Vector Teams;
private int cost = 0;
private int Total = 0;
private Vector Team1 = new Vector();
private Vector Team2 = new Vector();
//Construcor to display GUI for second player to select teams
public Selection2(Vector team, Vector team1) {
Teams = team;
Team1 = team1;
panel7 = new JPanel();
label8 = new JLabel();
this.getContentPane().setLayout(new GridLayout(11, 0));
label1 = new JLabel(
"Please select your teams from below. Some of the teams have already been taken");
team1 = new JCheckBox(team.get(0).toString());
team1.addActionListener(this);
label2 = new JLabel("£" + team.get(1).toString());
team2 = new JCheckBox(team.get(2).toString());
team2.addActionListener(this);
label3 = new JLabel("£" + team.get(3).toString());
team3 = new JCheckBox(team.get(4).toString());
team3.addActionListener(this);
label4 = new JLabel("£" + team.get(5).toString());
team4 = new JCheckBox(team.get(6).toString());
team4.addActionListener(this);
label5 = new JLabel("£" + team.get(7).toString());
team5 = new JCheckBox(team.get(8).toString());
team5.addActionListener(this);
label6 = new JLabel("£" + team.get(9).toString());
//If a team is already selected, disable the selection
if (team.get(1).toString().equalsIgnoreCase("Taken")) {
team1.setEnabled();
}
if (team.get(3).toString().equalsIgnoreCase("Taken")) {
team2.setEnabled(false);
}
if (team.get(5).toString().equalsIgnoreCase("Taken")) {
team3.setEnabled(false);
}
if (team.get(7).toString().equalsIgnoreCase("Taken")) {
team4.setEnabled(false);
}
if (team.get(9).toString().equalsIgnoreCase("Taken")) {
team5.setEnabled(false);
}
if (team.get(11).toString().equalsIgnoreCase("Taken")) {
team6.setEnabled(false);
}
team6 = new JCheckBox(team.get(10).toString());
team6.addActionListener(this);
label7 = new JLabel("£" + team.get(11).toString());
panel1 = new JPanel(new GridLayout(0, 2));
panel1.add(team1);
panel1.add(label2);
panel2 = new JPanel(new GridLayout(0, 2));
panel2.add(team2);
panel2.add(label3);
panel3 = new JPanel(new GridLayout(0, 2));
panel3.add(team3);
panel3.add(label4);
panel4 = new JPanel(new GridLayout(0, 2));
panel4.add(team4);
panel4.add(label5);
panel5 = new JPanel(new GridLayout(0, 2));
panel5.add(team5);
panel5.add(label6);
panel6 = new JPanel(new GridLayout(0, 2));
panel6.add(team6);
panel6.add(label7);
panel7.add(label8);
button1 = new JButton("Next -->");
button1.addActionListener(this);
this.getContentPane().add(label1);
this.getContentPane().add(new JLabel());
this.getContentPane().add(panel1);
this.getContentPane().add(panel2);
this.getContentPane().add(panel3);
this.getContentPane().add(panel4);
this.getContentPane().add(panel5);
this.getContentPane().add(panel6);
this.getContentPane().add(new JLabel());
this.getContentPane().add(panel7);
this.getContentPane().add(button1);
this.setSize(410, 270);
this.setLocation(500, 300);
this.show();
}
//Respond to user actions
public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
if (s.equals("Next -->")) {
this.dispose();
new Instructions(Team1, Team2);
} else {
Team2.add(s);
label8.setText("");
label8.setForeground(Color.RED);
int i = Teams.indexOf(s);
cost = Integer.parseInt(Teams.get(i + 1).toString());
Total += cost;
//If player has gone over budget, display error message
if (Total > 600000) {
Team1.clear();
team1.setSelected(false);
team2.setSelected(false);
team3.setSelected(false);
team4.setSelected(false);
team5.setSelected(false);
team6.setSelected(false);
label8
.setText("You have gone over your budget. Please re-select your teams");
Total = 0;
}
}
}
}
the output is:
symbol : method add(java.util.Vector)
location: class javax.swing.JPanel
panel1.add(team1);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
please any help from anyway will be highly appreciated