This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Oct 24, 2009 12:33 PM by 843789 RSS

cannot find symbol constructor error <--i've been working on this forever!

843789 Newbie
Currently Being Moderated
the lines that are underlined are the ones that have an error:
//skipping import statements here to save space

public class TravelGUI extends JFrame implements ActionListener,ItemListener{

private TravelManager manager;
private String[] reservationTypes = {"Airline Reservation","Hotel Reservation","Car Reservation"};
private String[] arrivalCity = {"New York", "Boston", "Los Angeles"};
private String[] airlineName = {"American Airlines", "Continental Airlines", "United Airlines", "Southwest Airlines"};
private String[] departureCity = {"Dallas", "Chicago"};
private String[] hotelName = {"Sheraton", "Radisson", "Holiday Inn", "Fairfield Inn"};
private String[] carCompanyName = {"Hertz", "Avis", "Enterprise", "Budget"};
private String[] carSize = {"Economy", "Midsize", "Luxury"};
private String reservationType;
//skipping a few grid setting things to save space...........................
     //**********************************************************
     //skipping the initializing reservation data panel part

     //**********************************************************
//skipping some dimension settings
//skipping actionPerformed part

// Create and store a Reservation object by reservation type
     if(reservationType.equals("Airline Reservation")){
          Reservation newReservation = new AirlineReservation(flier,(String)jcboArrivalCity.getSelectedItem(),(String)jcboAirlineName.getSelectedItem(), (String)jcboDepartureCity.getSelectedItem());
          manager.addReservation(newReservation);
          displayFlier(flier);
          clearReservationFields();
     }else if(reservationType.equals("Hotel Reservation")){
          Reservation newReservation = new HotelReservation(flier,(String)jcboArrivalCity.getSelectedItem(),(String)jcboHotelName.getSelectedItem(),Integer.parseInt(jtfNumDays.getText().trim()));
          manager.addReservation(newReservation);
          displayFlier(flier);
          clearReservationFields();
     }else if(reservationType.equals("Car Reservation")){
          Reservation newReservation = new CarReservation(flier,(String)jcboArrivalCity.getSelectedItem(),(String)jcboCarCompanyName.getSelectedItem(),(String)jcboCarSize.getSelectedItem(),Integer.parseInt(jtfNumDays.getText().trim()));+
          manager.addReservation(newReservation);
          displayFlier(flier);
          clearReservationFields();
     }

}else if (ae.getSource() == jbtDisplayFliers) {
          //skip skip
}

public void itemStateChanged(ItemEvent ie){
if(ie.getSource() == jcboReservationTypes){
     if(jcboReservationTypes.getSelectedItem().equals("Airline Reservation")){
          reservationType = "Airline Reservation";
          jlblAirlineName.setText("Airline Name");
          jcboArrivalCity.setEnabled(true);
          jcboAirlineName.setEnabled(true);
          jcboDepartureCity.setEnabled(true);
          jcboHotelName.setEnabled(false);
          jtfNumDays.setEnabled(false);
          jcboCarCompanyName.setEnabled(false);
          jcboCarSize.setEnabled(false);
          
     }else if(jcboReservationTypes.getSelectedItem().equals("Hotel Reservation")){
          reservationType = "Hotel Reservation";
          jlblHotelName.setText("Hotel Name");
          jcboArrivalCity.setEnabled(true);
          jcboAirlineName.setEnabled(false);
          jcboDepartureCity.setEnabled(false);
          jcboHotelName.setEnabled(true);
          jtfNumDays.setEnabled(true);
          jcboCarCompanyName.setEnabled(false);
          jcboCarSize.setEnabled(false);
     }else if(jcboReservationTypes.getSelectedItem().equals("Car Reservation")){
          reservationType = "Car Reservation";
          jlblCarCompanyName.setText("Car Company Name");
          jcboArrivalCity.setEnabled(true);
          jcboAirlineName.setEnabled(false);
          jcboDepartureCity.setEnabled(false);
          jcboHotelName.setEnabled(false);
          jtfNumDays.setEnabled(true);
          jcboCarCompanyName.setEnabled(true);
          jcboCarSize.setEnabled(true);
     }else{
          reservationType = null;
     }
}
}

public void storeDatabase(){
     Flier c0 = new Flier("Rocket","Squirrel","972-555-1001");
     manager.addFlier(c0);
     AirlineReservation a1 = new AirlineReservation(c0,"New York","American Airlines","Dallas");
     HotelReservation a2 = new HotelReservation(c0,"New York","Sheraton",3);
     CarReservation a3 = new CarReservation(c0,"New York",4,"Hertz","Luxury");+
     manager.addReservation(a1);
     manager.addReservation(a2);
     manager.addReservation(a3);

     Flier c1 = new Flier("Bullwinkle","Moose","972-555-2002");
     manager.addFlier(c1);
     AirlineReservation a4 = new AirlineReservation(c1,"Boston","Southwest Airlines","Dallas");
     HotelReservation a5 = new HotelReservation(c1,"Boston","Holiday Inn",5);
     CarReservation a6 = new CarReservation(c1,"Boston",4,"Budget","Economy");+
     manager.addReservation(a4);
     manager.addReservation(a5);
     manager.addReservation(a6);

     Flier c2 = new Flier("Boris","Badenov","972-555-3003");
     manager.addFlier(c2);
     AirlineReservation a7 = new AirlineReservation(c2,"Los Angeles","Continental Airlines","Dallas");
     HotelReservation a8 = new HotelReservation(c2,"Los Angeles","Fairfield Inn",4);
     CarReservation a9 = new CarReservation(c2,"Los Angeles",4,"Enterprise","Midsize");+
     manager.addReservation(a7);
     manager.addReservation(a8);
     manager.addReservation(a9);
     
}

public void displayFlier(Flier flier){
     jtaFlierReservations.setText("");
     displayReservations(flier);
}

public void displayReservations(Flier flier){
     Vector<Reservation> reservations = manager.getFlierReservations(flier);
     if(reservations == null){
          jtaFlierReservations.append("Flier has no reservations\n");
     }else{
          Iterator<Reservation> reservationIter = reservations.iterator();
          while(reservationIter.hasNext()){
               jtaFlierReservations.append(reservationIter.next().toString() + "\n");
          }          
     }
}
//skipping clearReservationFields

public static void main(String[] args) {new TravelGUI();}
}
and for all for em it says: cannot find symbol constructor. This is due this coming tuesday! :( i'd appreciate any helpful replies, thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
1 2 Previous Next