Question: Make sure to have all three classes which are Project1 DateGUI Date212 Thanks Sorting an Array of Dates/ Displaying in a GUI/Creating a Class Given
Sorting an Array of Dates/ Displaying in a GUI/Creating a Class Given an input file of dates represented as Strings, read the dates from the file and display them in a GUI. The dates will be in the form yyyymmdd (such as 20181001 for October 1, 2018). The GUI should have a GridLayout with one row and two columns. The left column should display the dates in the order read from the file, and the right column should display the dates in sorted order (using Selection Sort). Create a class called Date212 to represent a date. It will store the year, month and day as integers (not as a String), so you will need three private instance variables. A constructor should be provided that takes a String (representing the date as above). Use the substring method of class String to pull out the month, day and year, and parse them as integers. Include a private validity checking method that should make sure that the month and day values are legal. If it is not a valid date, print it to the console and do not put it in the array of dates. Create a toString method in class Date 212 the will return the date in the form mm/dd/yyyy. Use this method to display the dates in the GUI Use two arrays containing Date212 objects, one containing valid dates in the order read from the file the other read in and then sorted using Selection Sort. The input file Each line of the input file may contain several dates separated by commas. You will need to use a StringTokenizer to separate out the individual dates. So, an example of the input file would be 20141001 20080912,20131120,19980927 20020202 20120104 Submitting the Project. You should have three files to submit for this project: Projectl.java DateGUI.java Date212.java Upload your project to Blackboard by the due date for full credit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
