// Main method for testing the class
  public static void showDialogue(String[] Airports) {
    String[] Carriers = {"Delta", "Southwest", "United"};
    // String[] Airports = {"OMA", "DAB", "MCO"};

    Route_addroute_dialogue Test = new Route_addroute_dialogue(Airports);

    // need to figure out what size to have the frame be and set resizable to false!
    Test.setTitle("Add Route");
    // Test.setSize(500,650);									// Set the size
    Test.setLocationRelativeTo(null); // Center it on the screen
    Test.setVisible(true); // Make it visible
  }
Example #2
0
    public void actionPerformed(ActionEvent event) {
      String historyText = "";
      if (systemLocked == false) {
        // addRouteCount = 1;
        String[]
            airportsArray; // create empty array that will be used for the method that finds the
                           // airports list
        String[] routesArray;
        routesArray = routeNumArray(routesInfo);
        airportsArray =
            convertAirportArrayListToArray(
                airportsInfo); // call airportsArrayList method to get list of airports

        Route_addroute_dialogue routeDialog =
            new Route_addroute_dialogue(airportsArray, routesArray);
        routeDialog.showDialogue(airportsArray, routesArray); // show the add route dialog box.
      } else {
        historyText = "You must open a valid file to be able to perform this action.\n";
        historyArea.append(historyText);
      }
    }