Hi all, I have a class CAR.java
public class CAR {
private int ID;
private String model;
public CAR(int ID, String model) {
this.ID = ID;
this.model = model;
}
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
public int getmodel() {
return model;
}
public void setmodel(int model) {
this.model = model;
}
/* ********************* */
and the file CARInitialData.java
public class CARInitialData {
private List<CAR> list;
private static final int carCounter = 1;
public CARInitialData() {
list = new ArrayList<CAR>();
list.add(new CAR(carCounter,"Audi A3"));
list.add(new CAR(carCounter+1,"Audi A5"));
}
public List<CAR> getCARList() {
return list;
}
}
/* ********************* */
I am using netbeans and I am trying to make a menu page, a display page form and edit rows form.
in mainmenu.java file
public class mainmenu extends javax.swing.JFrame {
public CARInitialData initialCARData;
private Vector row;
public List<CAR> CARList;
public mainmenu() {
initComponents();
initialCARData = new CARInitialData();
CARList = initialCARData.getCARList();
}
}
but how can I access these list of CARs from display page or edit page.
Could you help me please with an example because I am confused.
Thanks in advance