Departcity1 new jlabelenter a departure city

This preview shows page 1 - 3 out of 4 pages.

departCity1 = new JLabel("Enter a departure city");departDay1 = new JLabel("Enter a departure day");departTime1 = new JLabel("Enter a departure time");arriveCity1 = new JLabel("Enter an arrival city");arriveDay1 = new JLabel("Enter an arrival day");arriveTime1 = new JLabel("Enter an arrival time");airFare1 = new JLabel("Airfare");// Creating the text-fields that the user will put data intoairlineName2 = new JTextField();flightNum2 = new JTextField();departCity2 = new JTextField();departDay2 = new JTextField();departTime2 = new JTextField();arriveCity2 = new JTextField();arriveDay2 = new JTextField();arriveTime2 = new JTextField();
airFare2 = new JTextField();// adding the labels and text fields to the panel//There is probably a better way to do this but I havent cracked that yet... :)input.add(airlineName1);input.add(airlineName2);input.add(flightNum1);input.add(flightNum2);input.add(departCity1);input.add(departCity2);input.add(departDay1);input.add(departDay2);input.add(departTime1);input.add(departTime2);input.add(arriveCity1);input.add(arriveCity2);input.add(arriveDay1);input.add(arriveDay2);input.add(arriveTime1);input.add(arriveTime2);input.add(airFare1);input.add(airFare2);button = new JButton("Create a flight");input.add(button);add(input);// *************************************************************output = new JPanel();output.setLayout(new BoxLayout(output, BoxLayout.Y_AXIS)); //set thelayout of the output panelmsg = new JLabel("");msg.setForeground(Color.RED); //Set the messages that show up to redoutput.add(msg);output.add(input);output.add(button);info = new JTextArea(); // area where user can see flights addedinfo.setText("No flight");info.setEditable(false);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture