estoy intentando crear un listado de vehículos hice 4 clases la clase padre y las hijas que son terrestres aéreas y marítimas.
lo que hago es algo así
public static ArrayList<Transportation> transportations = new ArrayList<Transportation>();
y le agrego datos así
Transportation overland = new Overland("1", "451fsfd4", "p0245", "serie 5", "2016", "4", "4 persons", 165000.00, 5, "Honda civic", 1);
Transportation overland1 = new Overland("2", "4444531s4", "oq45", "prueba", "2011", "4", "4 persons", 565000.00, 7, "bugati", 1);
Transportation Aerial = new Aerial("3", 2, 3, 2, 1000000.00, "aeroplano", 2, 4);
Transportation Maritimo = new Maritimos("4", "serie 4", "BAVARIA", "30 personas", 3000000.00, "yate prueba", "lancha", 3, 1);
transportations.add(overland); transportations.add(overland1);
transportations.add(Aerial); transportations.add(Maritimo);
intento insertarlos en un JList algo así
JList list= new JList();
list.setModel(transportations);
también probé mandarselo
for (Transportation trasporte : trasportstions) {
post.setModel(transporte);
}
agradeceria mucho la ayuda.