Explore BrainMass

Modify MortgageDisplayGui.java

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Modify MortgageDisplayGui.java to implement ActionListener.java
? Associate the current action listener with
? Write the action Performed function to perform the following tasks:
o Interrogate the ActionEvent object and determine the source of the action.
o Based on the source of the action call one of four functions
 Quit()
 Calculate()
 Exit()
 ViewAmortization()
? Modify the mortgage program to add the following behaviors
o The Calculate button actions
 Determine the payment, based on user input and using the calculator work from UTIL package (modify if needed). Display the configured payment in the payment box.
o The Reset button actions
 Reset all the values in the text fields to blank
 Reset the values in the calculator to new or empty
o The Quit button
 Exits the System
o The viewAmortization button
 Pop up a dialog that displays the payment matrix in a JTextArea that is inside a JscrollPane. Use the toString ()function already in the Row class to write each line of the amortization table to the dialog.
 The dialog class will be called ScheduleDialog.java and will inherit from the JDialog class. The dialog constructor will take a Vector as an argument.
 Package the ScheduleDialog.java in the src.calculator.gui.
? Modify the mortgage program to disable the viewAmortization button if there is no payment displayed and enable it when there is a payment displayed.

© BrainMass Inc. brainmass.com October 24, 2018, 5:51 pm ad1c9bdddf


Solution Preview

Dear Student,
<br>Please Follow the instructions in the ...

Solution Summary

Modify MortgageDisplayGui.java to implement ActionListener.java

See Also This Related BrainMass Solution


Also, the program should not except a neg number.

1. Modify the ScheduleDialog.java to have a button panel that will save the output to a file, read and display file content, and clear the text area:

Write a class DataIOException.java that implements Throwable;

Write an Interface called Amortization TableInterface that retrieves data for the amortization table.
The interface should provide the functions
Public Row[] getData() throws DataIOException;

Write a concrete class called Amortization TableInterfaceImpl that implements these functions, by reading and writing the Row[] to a file and from a file, via the getData and setData interface functions

CHANGE: Place class in UTIL and remove DATA file..
Store the Interface, Exception and concrete class in the package src.calculator.data

2. Modify the ScheduleDialog.java:
-class to include a new JPanel for the buttons, similar to the one in the main GUI
-add three buttons, clear, save, read
-have the ScheduleDialog., implement action listener

Write the actionPerformed function to interrogate the Event object and determine which button is responsible for the event and call one of three functions: readSchedule(), saveSchedule(), clearView().

Make sure that the clear and the write buttons are disabled if there is no content in the display and enabled if there is content.

Try and catch for DataIOException and upon error, report the Error to the user via a JoptionPane using the ERROR_MESSAGE and DEFAULT_OPTION constants provided by the JoptionPane class

3. Modify the MortgageDisplayGui.java:

Include a member of the Amortization TableInterfaceImpl tableInterface.

Add a new constructor to the MortgageDisplayGui to accept the tableInterface

Public MortgageDisplayGui(Amortization TableInterfacelmpl tableInterface)


so in MortgageDisplayGui

1. create another in the class

JButton dataButton;

2. in the init() functions

dataButton = new JButton("Data");

3. in the actionPerformed(ACtionEvent ev);

//add another if statement when checking buttons
if( == dataButton)

4. write a viewData() functions that

pubic void viewData(){

// use the scheduleDialog variable to just set the dialog visible.
// the dialog should appear with a blank field and your 3 buttons

View Full Posting Details