What does the error mean and how can I solve it? It is a database of a bank in which I have to use a type "branch" but I can not use it add that type To My arrayList
ArrayList Array_Asesores = new ArrayList();
Here is the code porfavorrr ...
public class asesor {
private int IDASESOR;
private sucursal Sucursal;
private String Nombre_asesor;
private String Direccion;
private String email;
private int num_cel;
private int edad;
//Constructor
public asesor(int IDASESOR_, String Nombre_asesor_, String Direccion_, sucursal Sucursal_, String email_, int num_cel_, int edad_) {
IDASESOR = IDASESOR_;
Nombre_asesor = Nombre_asesor_;
Direccion = Direccion_;
Sucursal = Sucursal_;
email=email_;
num_cel= num_cel_;
edad = edad_;
}
public int getIDASESOR(){
return IDASESOR;
}
public void setIDASESOR (int Idasesor){
this.IDASESOR=Idasesor;
}
public String getNombre_asesor(){
return Nombre_asesor;
}
public void setNombre_asesor(String Nombre_ase){
this.Nombre_asesor=Nombre_ase;
}
public String getDireccion(){
return Direccion;
}
public void setDireccion(String Direc){
this.Direccion=Direc;
}
public sucursal getSucursal(){
return Sucursal;
}
public void setSucursal(sucursal Sucu){
this.Sucursal=Sucu;
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
/* IDASESOR = IDASESOR_;
Nombre_asesor = Nombre_asesor_;
Direccion = Direccion_;
Sucursal = Sucursal_;
email=email_;
num_cel= num_cel_;
edad = edad_;
*/
String IDAS1=IDAS.getText();
String NOM1=NOM.getText();
String DIR1=DIR.getText();
String SUC1=SUC.getText();
String EMA1=EMA.getText();
String NUMC1=NUMC.getText();
String EDA1=EDA.getText();
if (!IDAS1.isEmpty()) {
if (!NOM1.isEmpty()) {
if (!DIR1.isEmpty()) {
if (!SUC1.isEmpty()) {
if (!EMA1.isEmpty()) {
if (!NUMC1.isEmpty()) {
if (!EDA1.isEmpty()) {
int IDAS2=Integer.parseInt(IDAS1);
int NUMC2=Integer.parseInt(NUMC1);
int EDA2=Integer.parseInt(EDA1);
asesor nuevo = new asesor(IDAS2, NOM1, DIR1, SUC1, EMA1, NUMC2, EDA2);
Array_Asesores.add(nuevo);
DAT.setText("Datos guardados con exito");
}else{
JOptionPane.showMessageDialog(null,"Caja de texto Edad esta vacía");
EDA.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto celular esta vacía");
NUMC.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto Email esta vacía");
EMA.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto Sucursal esta vacío");
SUC.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto dirección vacío");
DIR.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto nombre asesor esta vacío");
NOM.requestFocusInWindow();
}
}else{
JOptionPane.showMessageDialog(null,"Caja de texto Id asesor esta vacía");
IDAS.requestFocusInWindow();
}
}
I need to turn in the work today afternoon friends, Thanks for your help
Here I leave the code of the other class "Branch" which is what I want to use in my other class "Advisor"
package clases;
/** * * @author Vivian Herrera */ public class sucursal {
private int IDSUCURSAL;
private String Nombre_sucursal;
private String Direccion_sucursal;
private int Telefono;
private String Localidad;
public sucursal(int IDSUCURSAL_, String Nombre_sucursal_, String Direccion_sucursal_,int T,String L) {
IDSUCURSAL = IDSUCURSAL_;
Nombre_sucursal = Nombre_sucursal_;
Direccion_sucursal = Direccion_sucursal_;
Localidad = L;
Telefono = T;
}
public int getIDSUCURSAL(){
return IDSUCURSAL;
}
public void setIDSUCURSAL (int IDSUCURSAL){
this.IDSUCURSAL=IDSUCURSAL;
}
public String getNombre_sucursal(){
return Nombre_sucursal;
}
public void setNombre_sucursal(String Nombre_sucursal){
this.Nombre_sucursal=Nombre_sucursal;
}
public String getDireccion_sucursal(){
return Direccion_sucursal;
}
public void setDireccion_sucursal(String Direccion_sucursal){
this.Direccion_sucursal=Direccion_sucursal;
}
public String getLocalidad(){
return Localidad;
}
public void setLocalidad(String Local){
this.Localidad=Local;
}
public int getTelefono(){
return Telefono;
}
public void setTelefono (int Tele){
this.Telefono=Tele;
}
}