...

View Full Version : JOptionPane help



beafcake101
01-28-2012, 09:31 PM
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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum