//Nuevo panel jugadores ya inscritos
private static ArrayList<jugador> jugadores = new ArrayList<jugador>();
private JList listDatos
= new JList(jugadores.
toArray()); private JLabel lblTodosLosJugadores
= new JLabel("Jugadores inscritos en la FEB:");
/**
* Launch the application.
*/
public static void main
(String[] args
) {
public void run() {
try {
RegistroClientes2 frame = new RegistroClientes2();
frame.setVisible(true);
e.printStackTrace();
}
}
});
System.
out.
println(jugadores.
isEmpty());
jugador j1 = new jugador("Michael", "Jordan", "Hombre", 54,"RRTTTEEE", "Chi town","USA",
"", "Chicago", "566899", "555 654 8999", "thegreatestmail", "196","90", "FC Barcelona Lassa",
"Senior", "Liga Endesa", 23, "escolta");
jugadores.add(j1);
System.
out.
println(jugadores.
isEmpty());
for(int i = 0; i < jugadores.size(); i ++){
System.
out.
println(jugadores.
get(i
).
verInfoJug());
}
}
/**
* Create the frame.
*/
public RegistroClientes2() {
//Boton Registrar
btnRegistro.setBounds(240, 446, 139, 23);
panel.add(btnRegistro);
btnRegistro.setEnabled(false);
btnRegistro.addActionListener(this);
//Mostrar Jugadores Creados
tabbedPane.addTab("Jugadores existentes", null, panel_1, null);
panel_1.setLayout(null);
listDatos.setBounds(26, 65, 560, 408);
listDatos.setBorder(border);
panel_1.add(listDatos);
lblTodosLosJugadores.
setFont(new Font("Arial",
Font.
BOLD,
18)); lblTodosLosJugadores.setBounds(26, 32, 560, 22);
panel_1.add(lblTodosLosJugadores);
tabbedPane.addTab("Equipos", null, panel_2, null);
}
@Override
if(e.getSource().equals(checkClickAquSi)){
if(checkClickAquSi.isSelected()){
textCM.setEnabled(true);
textKG.setEnabled(true);
cbEquipos.setEnabled(true);
chckbxBase.setEnabled(true);
chckbxEscolta.setEnabled(true);
chckbxAlero.setEnabled(true);
chckbxAlapvot.setEnabled(true);
chckbxPvot.setEnabled(true);
chckbxRegistro.setEnabled(true);
spinnerNumero.setEnabled(true);
comboBoxCat.setEnabled(true);
comboBoxCompeti.setEnabled(true);
}
}
if(e.getSource().equals(checkClickAquSi)){
if(checkClickAquSi.isSelected() == false){
textCM.setEnabled(false);
textKG.setEnabled(false);
cbEquipos.setEnabled(false);
chckbxBase.setEnabled(false);
chckbxEscolta.setEnabled(false);
chckbxAlero.setEnabled(false);
chckbxAlapvot.setEnabled(false);
chckbxPvot.setEnabled(false);
chckbxRegistro.setEnabled(false);
spinnerNumero.setEnabled(false);
comboBoxCat.setEnabled(false);
comboBoxCompeti.setEnabled(false);
}
}
if(e.getSource().equals(chckbxRegistro)){
if(chckbxRegistro.isSelected() == true){
btnRegistro.setEnabled(true);
}
}
if(e.getSource().equals(chckbxRegistro)){
if(chckbxRegistro.isSelected() == false){
btnRegistro.setEnabled(false);
}
}
}
@Override
if(e.getSource().equals(comboBoxPaises)){
if(comboBoxPaises.getSelectedItem().toString().equalsIgnoreCase("España")){
comboBoxProvincias.setEnabled(true);
}
}
if(e.getSource().equals(comboBoxPaises)){
if(!comboBoxPaises.getSelectedItem().toString().equalsIgnoreCase("España")){
comboBoxProvincias.setEnabled(false);
}
}
if(e.getSource().equals(mnSalir)){
Object[] txtSalir
= {"SI",
"NO"};
int opcion
= JOptionPane.
showOptionDialog(getContentPane
(),
"¿Seguro que deseas salir?",
"Estas a un click de salir",
null,
txtSalir,
txtSalir[1]);
if (opcion == 0){
}
}
if(e.getSource().equals(btnRegistro)){
int edadSpin
= Integer.
parseInt(edad.
getValue().
toString()); int numeroSpin
= Integer.
parseInt(spinnerNumero.
getValue().
toString());
if(chckbxBase.isSelected()){ base = chckbxBase.getText(); }
if(chckbxEscolta.isSelected()){ escolta = chckbxEscolta.getText(); }
if(chckbxAlero.isSelected()){ alero = chckbxAlero.getText(); }
if(chckbxAlapvot.isSelected()){ alapivot = chckbxAlapvot.getText(); }
if(chckbxPvot.isSelected()){ pivot = chckbxPvot.getText(); }
jugador j = new jugador(textNombre.getText(), textApellido.getText(),
grupoSexo.getSelection().getActionCommand(), edadSpin,
textDNI.getText(), textCalle.getText(), comboBoxPaises.getSelectedItem().toString(),
comboBoxProvincias.getSelectedItem().toString(), textCiudad.getText(),
textCod.getText(), textTLF.getText(), textEmail.getText(), textCM.getText(),
textKG.getText(), cbEquipos.getSelectedItem().toString(),
comboBoxCat.getSelectedItem().toString(), comboBoxCompeti.getSelectedItem().toString(),
numeroSpin, base+" "+ escolta + " " + alero + " " + alapivot + " " + pivot);
jugadores.add(j);
}
}
}