Explore BrainMass

Explore BrainMass

    JAVA PROBLEM

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

    Write a Java program using a graphical user interface accepts user input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage and display the payment Allow the user to loop back and enter new data or quit. Insert comments in the program to document the program.

    © BrainMass Inc. brainmass.com March 4, 2021, 5:59 pm ad1c9bdddf
    https://brainmass.com/computer-science/java/java-problem-22421

    Attachments

    Solution Preview

    //Note: JBuilder platform used to build GUI code
    <br>
    <br>import java.awt.*;
    <br>import java.awt.event.*;
    <br>import javax.swing.*;
    <br>import com.borland.jbcl.layout.*;
    <br>import java.util.*;
    <br>
    <br>public class Frame1 extends JFrame {
    <br> JPanel contentPane;
    <br> JTextPane jTextPane1 = new JTextPane();
    <br> XYLayout xYLayout1 = new XYLayout();
    <br> JTextPane jTextPane2 = new JTextPane();
    <br> JTextPane jTextPane3 = new JTextPane();
    <br> JTextPane jTextPane4 = new JTextPane();
    <br> JButton jButton1 = new JButton();
    <br> JButton jButton2 = new JButton();
    <br> JButton jButton3 = new JButton();
    <br> JTextPane jTextPane5 = new JTextPane();
    <br> JTextArea jTextArea1 = new JTextArea();
    <br> JTextArea jTextArea2 = new JTextArea();
    <br> JTextArea jTextArea3 = new JTextArea();
    <br> JTextArea jTextArea4 = new JTextArea();
    <br> JTextPane jTextPane6 = new JTextPane();
    <br> JTextPane jTextPane7 = new JTextPane();
    <br>
    <br> //Construct the frame
    <br> public Frame1() {
    <br> enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    <br> try {
    <br> jbInit();
    <br> }
    <br> catch(Exception e) {
    <br> e.printStackTrace();
    <br> }
    <br> }
    <br>
    <br> //Component initialization
    <br> private void jbInit() throws Exception {
    <br> contentPane = (JPanel) this.getContentPane();
    <br> jTextPane1.setFont(new java.awt.Font("Arial", 1, 16));
    <br> jTextPane1.setNextFocusableComponent(null);
    <br> jTextPane1.setText("Welcome to Mortgage Calculator");
    <br> ...

    $2.19

    ADVERTISEMENT