Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post

    JOptionPane help

    Hey everyone,
    I had a quick question about JOptionPanes that I hope someone can answer. I am creating a loan program that takes in a users loan, then they decide between 3 different loan options and click calculate and it spits out the monthly payment, the interest paid, so on and so forth, it will also loop all the way through each payment showing how much they paid. I used a JOptionPane to display all the information and once you click on on the new window another window pops up showing the next months information. I need to figure out a way to either give the close [X] in the top of the window, or use a different option pane to get another button to allow me to exit the JOptionPane to go back to the original GUI, an example of ym code is this:

    [CODE]if(option1.isSelected()){

    for (int mp = 1; mp <= (totalpayments[0]); mp++){
    intpaid[0] = (loanbalance[0] * paymentint[0]);
    loanpay[0] = (monthlypayment[0] - intpaid[0]);
    loanbalance[0] = (loanbalance[0] - loanpay[0]);

    JOptionPane.showMessageDialog(null, "Inital Loan Amount: $" + digit.format(loan) + "\nPayment #" + mp +
    " = $" + digit.format(monthlypayment[0]) + "\nRemaining Balance on loan is $" + digit.format(loanbalance[0]) + "\nAmount of loan paid was $" + digit.format(loanpay[0]) + "\nInterest paid was $" + digit.format(intpaid[0]), "Loan Payments", JOptionPane.PLAIN_MESSAGE);
    [CODE]

    Does anyone have any ideas?

  2. Users who have thanked beafcake101 for this post:

    ismailzd (02-02-2012)


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •