home equity loan for people with bad credit
import java.awt.*; //to create buttons, etc w/o actions import java.awt.event.*; //to create an circumstance or action import javax.swing.*; import javax.swing.JButton; //to create a button import javax.swing.JTextField; //to create a book field import java.text.DecimalFormat; //to goods quantitative info for money //Class public collection MortgageText extends JPanel implements ActionListener { //Global Variable fortified JComboBox MortCombo; fortified JLabel lblprincipal, lblinterestRate, lblTerm, lblmonthlyPayment; fortified JButton calculate, Clear; fortified JTextField principal, interestRate, Term, monthlyPayment; fortified TextArea MortTextField; open MortgageText() { String[] comboItems={"5.35","5.50","5.75",}; //creates labels and fields lblprincipal=new JLabel("Total Amount:"); capital = newborn JTextField("",10); lblinterestRate=new JLabel("Interest Rate:"); interestRate = newborn JTextField("",10); lblTerm=new JLabel("Term Years:"); Term = newborn JTextField("",10); lblmonthlyPayment=new JLabel("Monthly Payment:"); monthlyPayment = newborn JTextField("",10); MortCombo=new JComboBox(comboItems); MortTextField=new TextArea(10,120); / //create buttons intend = newborn JButton("Calculate"); //button utilised to intend mortgage payment calculate.setActionCommand("GO"); Clear = newborn JButton("Clear"); //button utilised to country accumulation from the fields Clear.setActionCommand("Clear"); //add state to button calculate.addActionListener(this); Clear.addActionListener(this); add(lblprincipal); add(principal); add(lblinterestRate); add(MortCombo); add(lblTerm); add(Term); add(lblmonthlyPayment); add(monthlyPayment); add(calculate); add(Clear); add(MortTextField); } open vacuum actionPerformed(ActionEvent e) { if ("GO".equals(e.getActionCommand())) { CalculateMortgage(); } else { principal.setText(""); interestRate.setText(""); Term.setText(""); monthlyPayment.setText(""); } } // principal.setText(interestRate.getText()); --this module feature the interestRate book earth and threefold it to the capital field open vacuum CalculateMortgage() { threefold dblprincipal=Double.parseDouble(principal.getText()); threefold dblinterestRate=Double.parseDouble((String)MortCombo.getSelectedItem()); int intTerm=Integer.parseInt(Term.getText()); DecimalFormat money = newborn DecimalFormat("$0.00"); threefold MonthlyPayment=0.0; threefold InterestPayment=0.0; threefold PrincipalBal=0.0; threefold MIntRate=dblinterestRate/1200; int MTerms=intTerm * 12; //monthly commercialism formula MonthlyPayment=(dblprincipal * MIntRate) / (1-Math.pow((MIntRate+1),-MTerms)); //converts Monthly Payment to quantitative format monthlyPayment.setText("" + (money.format(MonthlyPayment))); MortTextField.append("Month No.\t\tMonthly Payment\t\t\tLoan Balance\t\t\tInterest Payment\n"); MortTextField.append("1\t\t\t" + MonthlyPayment + PrincipalBal + InterestPayment + "\n"); for (int counter=1; furniture < MTerms; counter++) { MortTextField.append((counter + 1) + "\t\t\t" + MonthlyPayment + PrincipalBal + InterestPayment + "\n"); } } private noise vacuum createAndShowGui() { JFrame inclose = newborn JFrame("Calculator"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MortgageText myCa I poverty to add an ikon to the app thats settled on my computer????Fixed Rate Federal Private Student Loan Consolidation
No comments:
Post a Comment