Question: Write a program with a Graphical User Interface (GUI) that inputs a date in the usual American numerical format of Month/Day Year and displays it

 Write a program with a Graphical User Interface (GUI) that inputs

Write a program with a Graphical User Interface (GUI) that inputs a date in the usual American numerical format of Month/Day Year and displays it spelling out the month. Display an error message if the day is not between 1 and 31 and the month is not between 1 and 12. We will not worry about trying to catch February 30 or other short months. You can format the GUI in any way that works effectively. One possible format is shown below nter date 05 01 2018 convert May 1, 20 Your program should contain an array of the names of the month "January, "February", "March, "April", "May", "June", July "August, "September" The numerical month number (minus one) can be used as an index into the array Recall the general outline for a Swing GUI program. class Dates extends JFrame implements ActionListenert /instance variables for the widets: JLabels, JTextFields, JButtorn static String] monthNames "January" l Constructor i set up BoxLayout manager, I create new JLabels, JTextFields, JButton, put in instance variables, add to GUI f addActionListener for the button set default close operation, set visible publie Dateso W ActionPerformed: this is called when the button is clicked publie void actionPerformed(ActionEvent ev) / Get data from text fields Convert data from String to int Check for le-month -12,l day31, answer "Incorrect Date" if out of bounds // Format answer string, with name from monthNames array, day number, year number Il Set answer string text in the answer label Main program creates a new Dates) object, that's all it does

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!