Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Help with a looping issue for homework

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with a looping issue for homework

    My homework assignment asks us to "I have a question related to homework problem. I am using Netbeans as my IDE. To help understand the specific requirements I will post the assignment criteria
    " Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user's selection from a menu of available mortgage loans:
    - 7 years at 5.35%
    - 15 years at 5.5%
    - 30 years at 5.75%
    Use an array for the mortgage data for the different loans. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Allow the user to loop back and enter a new amount and make a new selection or quit. Please insert comments in the program to document the program."

    I have had a few issues within the program but I believe I have corrected most. Did I structure my code wrong?


    private void jCalculateButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
           // Create an array for the interest rate
            double[] interestRate = new double[3];
            interestRate[0] = 5.35;
            interestRate[1] = 5.5;
            interestRate[2] = 5.75;
     
     
     
            // Create an array for the number of years
            int[] numberOfYears = new int[3];
            numberOfYears[0] = 7;
            numberOfYears[1] = 15;
            numberOfYears[2] = 30;
            {
     
                // Define varibles
     
                int X = RateTerm.getSelectedIndex();
                while (X<3)
               {
     
                double P = 200000; //Principle
                double R = 0.0;	 //monthly interest rate
                double M = 0.0;	// Number of months for the loan
                double N = 0.0;	//Monthly Payment
     
                //create object to convert values to dollars and cents
                DecimalFormat cash = new DecimalFormat("$0.00");
     
                //calculate monthly interest rate
                R = interestRate[X] / (12 * 100);
     
                //calculate total number of months for loan
                M = numberOfYears[X] * 12;
     
                //Calculate Monthly Payment
                N = (P * (R * (Math.pow((1 + R), M)) / (Math.pow((1 + R), M) - 1)));
     
                this.jTxtMonthlyPayment.setText(+ interestRate[X] + "% for " + numberOfYears[X] + " years is "+ cash.format(N));
             X = X + 1;
     
            }
    Last edited by constancez; September 16th, 2010 at 11:42 AM.


  2. #2
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Help with a looping issue for homework

    Well, can you post ALL of your code. I can see a problem right away, you have 3 opening brackets, but only 1 closing.
            int[] numberOfYears = new int[3];
            numberOfYears[0] = 7;
            numberOfYears[1] = 15;
            numberOfYears[2] = 30;
            { // whats up with this line?

  3. The Following User Says Thank You to Brt93yoda For This Useful Post:

    JavaPF (September 16th, 2010)

  4. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with a looping issue for homework

    Here is my whole code

     import java.text.DecimalFormat;
    import javax.swing.JComboBox;
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
     
    /*
     * GUIForm.java
     *
     * Created on Sep 14, 2010, 7:16:57 AM
     */
    /**
     *
     * @author Connie's Desktop
     */
    public class GUIForm extends javax.swing.JFrame {
     
        private static class RateTerm {
     
     
            public RateTerm() {
     
            }
        }
     
        /** Creates new form GUIForm */
        public GUIForm() {
            initComponents();
        }
     
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
     
            jPrincipleLabel = new javax.swing.JLabel();
            RateTerm = new javax.swing.JComboBox();
            jTxtPrinciple = new javax.swing.JTextField();
            jPaymentLabel = new javax.swing.JLabel();
            jCalculateButton = new javax.swing.JButton();
            jClearButton = new javax.swing.JButton();
            jExitButton = new javax.swing.JButton();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTxtMonthlyPayment = new javax.swing.JTextArea();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Mortgage Calculator");
     
            jPrincipleLabel.setText("Principle");
     
            RateTerm.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "7 Years at 5.35%", "15 Years at 5.5%", "30 Years at 5.75%" }));
            RateTerm.setBorder(new javax.swing.border.MatteBorder(null));
            RateTerm.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    RateTermActionPerformed(evt);
                }
            });
     
            jTxtPrinciple.setBorder(null);
            jTxtPrinciple.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTxtPrincipleActionPerformed(evt);
                }
            });
     
            jPaymentLabel.setText("Monthly Payment");
     
            jCalculateButton.setText("Calculate");
            jCalculateButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jCalculateButtonActionPerformed(evt);
                }
            });
     
            jClearButton.setText("Clear");
            jClearButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jClearButtonActionPerformed(evt);
                }
            });
     
            jExitButton.setText("Exit");
            jExitButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jExitButtonActionPerformed(evt);
                }
            });
     
            jTxtMonthlyPayment.setColumns(20);
            jTxtMonthlyPayment.setRows(5);
            jTxtMonthlyPayment.setBorder(null);
            jScrollPane1.setViewportView(jTxtMonthlyPayment);
     
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(18, 18, 18)
                            .addComponent(jPrincipleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPaymentLabel)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(RateTerm, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jTxtPrinciple, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)))
                            .addGap(24, 24, 24)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jExitButton)
                                .addComponent(jClearButton)
                                .addComponent(jCalculateButton))))
                    .addContainerGap(54, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(32, 32, 32)
                    .addComponent(jPrincipleLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jTxtPrinciple, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(22, 22, 22)
                    .addComponent(RateTerm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(27, 27, 27)
                    .addComponent(jPaymentLabel)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jCalculateButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                            .addComponent(jClearButton)
                            .addGap(28, 28, 28)
                            .addComponent(jExitButton))
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE))
                    .addGap(26, 26, 26))
            );
     
            pack();
        }// </editor-fold>
     
        private void RateTermActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
                    //Declare variables
            String firstString = "7 Years at 5.35%";
            String secondString = "15 Years at 5.5%";
            String thirdString = "30 Years at 5.75%";
     
     
        }                                        
     
        private void jCalculateButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
           // Create an array for the interest rate
            double[] interestRate = new double[3];
            interestRate[0] = 5.35;
            interestRate[1] = 5.5;
            interestRate[2] = 5.75;
     
     
     
            // Create an array for the number of years
            int[] numberOfYears = new int[3];
            numberOfYears[0] = 7;
            numberOfYears[1] = 15;
            numberOfYears[2] = 30;
            {
     
                // Define varibles
     
                int X = RateTerm.getSelectedIndex();
                while (X<3)
               {
     
                double P = 200000; //Principle
                double R = 0.0;	 //monthly interest rate
                double M = 0.0;	// Number of months for the loan
                double N = 0.0;	//Monthly Payment
     
                //create object to convert values to dollars and cents
                DecimalFormat cash = new DecimalFormat("$0.00");
     
                //calculate monthly interest rate
                R = interestRate[X] / (12 * 100);
     
                //calculate total number of months for loan
                M = numberOfYears[X] * 12;
     
                //Calculate Monthly Payment
                N = (P * (R * (Math.pow((1 + R), M)) / (Math.pow((1 + R), M) - 1)));
     
                this.jTxtMonthlyPayment.setText(+ interestRate[X] + "% for " + numberOfYears[X] + " years is "+ cash.format(N));
             X = X + 1;
     
            }
     
        }                                                
        }
     
        private void jClearButtonActionPerformed(java.awt.event.ActionEvent evt) {                                             
            // making the clear button function
            jTxtPrinciple.setText("");
            jTxtMonthlyPayment.setText("");
        }                                            
    public JComboBox getRateTerm() {
             return RateTerm;
          }
     
    public void setRateTerm(JComboBox RateTerm) {
             this.RateTerm = RateTerm;}
     
     
        private void jExitButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
          System.exit(0);
        }                                           
     
        private void jTxtPrincipleActionPerformed(java.awt.event.ActionEvent evt) {                                              
            // TODO add your handling code here:
        }                                             
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
     
                public void run() {
                    new GUIForm().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify
        private javax.swing.JComboBox RateTerm;
        private javax.swing.JButton jCalculateButton;
        private javax.swing.JButton jClearButton;
        private javax.swing.JButton jExitButton;
        private javax.swing.JLabel jPaymentLabel;
        private javax.swing.JLabel jPrincipleLabel;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTxtMonthlyPayment;
        private javax.swing.JTextField jTxtPrinciple;
        // End of variables declaration
    }

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Help with a looping issue for homework

    Have you solved all your issues?

  6. #5
    Junior Member
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with a looping issue for homework

    No I haven't in fact I have made them a bit worse I think. I added a loop based off of an early assignment we had that did not use a GUI. but cannot figure out how to make it conform to a GUI. Any help you can give me to help me conform this to the assignment. Let me also add this is last weeks assignment that i have already received a filing grade for but my instructor hasn't gotten back to me yet on any of my questions. Here is my most recent updated code.

    import java.text.DecimalFormat;
    import javax.swing.JComboBox;
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
     
    /*
     * GUIForm.java
     *
     * Created on Sep 14, 2010, 7:16:57 AM
     */
    /**
     *
     * @author Connie's Desktop
     */
    public class GUIForm extends javax.swing.JFrame {
     
        private static class RateTerm {
     
            public RateTerm() {
            }
        }
     
        /** Creates new form GUIForm */
        public GUIForm() {
            initComponents();
        }
     
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
     
            jPrincipleLabel = new javax.swing.JLabel();
            RateTerm = new javax.swing.JComboBox();
            jTxtPrinciple = new javax.swing.JTextField();
            jPaymentLabel = new javax.swing.JLabel();
            jCalculateButton = new javax.swing.JButton();
            jClearButton = new javax.swing.JButton();
            jExitButton = new javax.swing.JButton();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTxtMonthlyPayment = new javax.swing.JTextArea();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Mortgage Calculator");
     
            jPrincipleLabel.setText("Principle");
     
            RateTerm.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "7 Years at 5.35%", "15 Years at 5.5%", "30 Years at 5.75%" }));
            RateTerm.setBorder(new javax.swing.border.MatteBorder(null));
            RateTerm.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    RateTermActionPerformed(evt);
                }
            });
     
            jTxtPrinciple.setBorder(null);
            jTxtPrinciple.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTxtPrincipleActionPerformed(evt);
                }
            });
     
            jPaymentLabel.setText("Monthly Payment");
     
            jCalculateButton.setText("Calculate");
            jCalculateButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jCalculateButtonActionPerformed(evt);
                }
            });
     
            jClearButton.setText("Clear");
            jClearButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jClearButtonActionPerformed(evt);
                }
            });
     
            jExitButton.setText("Exit");
            jExitButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jExitButtonActionPerformed(evt);
                }
            });
     
            jTxtMonthlyPayment.setColumns(20);
            jTxtMonthlyPayment.setRows(5);
            jTxtMonthlyPayment.setBorder(null);
            jScrollPane1.setViewportView(jTxtMonthlyPayment);
     
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addComponent(jPrincipleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPaymentLabel)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(RateTerm, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jTxtPrinciple, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(15, 15, 15)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jExitButton)
                        .addGroup(layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jCalculateButton))
                        .addComponent(jClearButton)))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(32, 32, 32)
                    .addComponent(jPrincipleLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jTxtPrinciple, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(22, 22, 22)
                    .addComponent(RateTerm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(27, 27, 27)
                    .addComponent(jPaymentLabel)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jCalculateButton)
                            .addGap(18, 18, 18)
                            .addComponent(jClearButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                            .addComponent(jExitButton))
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE))
                    .addContainerGap())
            );
     
            pack();
        }// </editor-fold>
     
        private void RateTermActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
            //Declare variables
            String firstString = "7 Years at 5.35%";
            String secondString = "15 Years at 5.5%";
            String thirdString = "30 Years at 5.75%";
     
     
        }                                        
     
        private void jCalculateButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
            // Create an array for the interest rate
            double[] interestRate = new double[3];
            interestRate[0] = 5.35;
            interestRate[1] = 5.5;
            interestRate[2] = 5.75;
     
     
     
            // Create an array for the number of years
            int[] numberOfYears = new int[3];
            numberOfYears[0] = 7;
            numberOfYears[1] = 15;
            numberOfYears[2] = 30;
            {
     
                // Define varibles
     
                int X = RateTerm.getSelectedIndex();
               {
     
                double P = 200000; //Principle
                double R = 0.0;	 //monthly interest rate
                double M = 0.0;	// Number of months for the loan
                double N = 0.0;	//Monthly Payment
     
                //create object to convert values to dollars and cents
                DecimalFormat cash = new DecimalFormat("$0.00");
     
                //calculate monthly interest rate
                R = interestRate[X] / (12 * 100);
     
                //calculate total number of months for loan
                M = numberOfYears[X] * 12;
     
     
                //Calculate Monthly Payment
                N = (P * (R * (Math.pow((1 + R), M)) / (Math.pow((1 + R), M) - 1)));
     
                //this.jTxtMonthlyPayment.setText(+ interestRate[X] + "% for " + numberOfYears[X] + " years is "+ cash.format(N));
     
     
    		// Create a loop which displays monthly payment
     
    		while (M > 0) {
     
     
     
    		//interest payment = IP, then calculate monthly interest payment
           				double IP = P * R;
     
     
     
    		//Principle Payment = PP, then calculate monthly principal payment
           				double PP = N - IP;
     
     
    		//calculate remaining principal balance
            				P  = P - PP;
     
     
     
     
    		// Amortization print out
           				//System.out.println("Number of payments" + M + "Monthly Payment= " + cash.format(N) + "Interest Payment= " + cash.format(IP) + "Mortgage Balance= " + cash.format(P));
                                    jTxtMonthlyPayment.setText("Number of payments=" + M + "Monthly Payment= " + cash.format(N) + "Interest Payment= " + cash.format(IP) + "Mortgage Balance= " + cash.format(P));
     
     
     
       		//count down number for the number of payments left
              	   		M = M - 1;
     
     
     
     
     
    				//end nested while loop
    				}
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
                }
     
     
     
     
     
     
     
     
     
     
        }                                                
        }
     
        private void jClearButtonActionPerformed(java.awt.event.ActionEvent evt) {                                             
            // making the clear button function
            jTxtPrinciple.setText("");
            jTxtMonthlyPayment.setText("");
        }                                            
        public JComboBox getRateTerm() {
            return RateTerm;
        }
     
        public void setRateTerm(JComboBox RateTerm) {
            this.RateTerm = RateTerm;
        }
     
        private void jExitButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
            System.exit(0);
        }                                           
     
        private void jTxtPrincipleActionPerformed(java.awt.event.ActionEvent evt) {                                              
            // TODO add your handling code here:
        }                                             
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
     
                public void run() {
                    new GUIForm().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify
        private javax.swing.JComboBox RateTerm;
        private javax.swing.JButton jCalculateButton;
        private javax.swing.JButton jClearButton;
        private javax.swing.JButton jExitButton;
        private javax.swing.JLabel jPaymentLabel;
        private javax.swing.JLabel jPrincipleLabel;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTxtMonthlyPayment;
        private javax.swing.JTextField jTxtPrinciple;
        // End of variables declaration
    }

  7. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Help with a looping issue for homework

    cannot figure out how to make it conform to a GUI
    Can you explain what your problem is?

Similar Threads

  1. Not Looping? (do - while) bad execution!
    By chronoz13 in forum Loops & Control Statements
    Replies: 1
    Last Post: November 23rd, 2009, 08:51 PM
  2. Homework help
    By cd247 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 11th, 2009, 05:56 PM
  3. need help with homework!
    By programmer12345 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 27th, 2009, 05:34 AM
  4. [SOLVED] looping, for,while,do-while.
    By chronoz13 in forum Loops & Control Statements
    Replies: 4
    Last Post: August 6th, 2009, 01:32 PM
  5. [SOLVED] What is cast operator and how to use it?
    By napenthia in forum Java Theory & Questions
    Replies: 11
    Last Post: April 27th, 2009, 06:11 AM