Solution 07 1DAM 11 00AM BIIS route search successful Departure Bus Station SAN Departure City San Diego Destination Bus Station LAX Destination City Los
Solution DAM AM BIIS route search successful Departure Bus Station SAN Departure City San Diego Destination Bus Station
Solution DAM AM BIIS route search successful Departure Bus Station SAN Departure City
route search successful Departure Bus Station SAN Departure City San Diego Destination Bus Station LAX Destination City Los
Solution DAM AM BIIS route search successful Departure Bus Station SAN
Departure City San Diego Destination Bus Station LAX Destination City Los
Solution DAM AM BIIS route search successful Departure Bus
Solution DAM AM BIIS
(Solution) 07'1DAM 11:00AM BIIS route search successful Departure Bus Station: SAN Departure City: San Diego Destination Bus Station: LAX Destination City: Los...

Category: General
Words: 1050
Amount: $12
Writer:

Paper instructions

Q1: The first part of the assignment involves creating very basic GUI controls: a frame, panel, and slider.Create a JFrame. Add a title to the frame called "Bus Route Reservation". Set the frame size to 475 by 500 pixels. Create a JPanel inside of the frame. You will be adding all of your UI components to this JPanel. [6 pts]Inside of the panel, create a label that says "Choose Color." Right below it, make a slider that changes the background color of the panel when the slider is moved to a particular color. The slider values should be RGB color values from 0 to 255 (or black to white). Assume that the RGB values for red, green, and blue are the same value - for instance: (240, 240, 240). The slider label's text should be replaced with the RGB value that the slider is currently on. [8 pts]Q2: Add functionality to search for an Itinerary.Create labels and text fields that allow the user to enter a bus type, a source bus station, and a destination bus station, as well as the departure time and the arrival time to search for one or more available bus routes in an Itinerary. Also, create a ComboBox (see Chapter 11) that will allow the user to select from a list of bus route Itineraries. Each item in the ComboBox represents an Itinerary element, e.g. the first comboBox element is the first Itinerary in the array. [15 pts]Methods:Your BusFrame class should include the following methods (The methods that check for validation must have message dialogs indicating to the user if the information entered in each text field is invalid):initComponents() : Method used to initialize UI components and controlsdefault constructor : Inside the default constructor, call the initComponents() methodconvertTime() : converts time string to a Time object and returns the Time objectcheckValidBusType() : returns true if entered bus type is valid and exists in BusType enum and can be converted to a BusType objectcheckValidBusStations(String src, String dest) : will return true if both the source and destination bus stations entered in the text fields exist in BusStation enumcheckValidTime(String depTime, String arriveTime) : checks if the time is in valid format (hh:mm a) and returns true if it is in the correct formatMake sure all text fields have error checking and exception handling for invalid input. For example, if the user enters an integer as a departure time instead of a String (ie 1200 instead of 12:00 PM), a JOptionPane error message should appear stating, "Incorrect format for departure time." If the bus type they entered is not in the BusType enum, then the option pane should say, "Bus type unavailable. Please choose a different bus type." If the bus station they entered is not in the BusStation enum, then the option pane should say, "Unknown city." Make sure the times are in hh:mm a format. [8 pts]Q3: Create a button that says Search and a button that says View. When the user clicks Search, the combobox will get populated. When the user clicks View, if all the fields are filled out and have valid input, a JOptionPane with a message dialog should appear stating, "Bus route search successful!" The frame should open a new JFrame with the title, "Bus Route Information," and a size of 475 by 500 pixels. This frame has the bus route information displayed in a JTextArea. [6 pts]Q4: In the RouteFrame class, you will need to display information for each BusRoute in the Itinerary [7 points].The addTo() method shown in the UML diagram is used to add information to the JTextArea for both one-way and connecting bus routes (when applicable). It takes in a String val, which is the string of information that needs to be appended to the JTextArea. (For instance, if you would like to append the String "Bus", that is the String that needs to be passed in inside your addTo() method call in the RouteFrame class). You need to display the following information in a JTextArea:Bus Type: Display the bus typeDeparture Bus Station: Display the source bus stationDeparture City: Display the departure city based on the departure bus station (use the getBusStationCity() method you implemented in the Unit 2/3 assignment to get the bus station city)Destination Bus Station: Display the destination bus stationDestination City: Display the destination city based on the destination bus station (use the getBusStationCity() method again)Departure Time: Display the departure timeArrival Time: Display the arrival timeBus Number: Display the bus numberCost: Display the total cost, which should be computed by the Itinerary object.sample output:

Answer

Get Essay Answer
1,200,000+ Questions
Satisfaction guaranteed