<div><span class="Apple-tab-span" style="white-space:pre;"> </span>output 콘솔에 뜨는건 되는데..</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>JOptionPane 을 사용해서 팝업을띄우는건 안되네요 ㅜㅜ 어떻게해야할까요?</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>새로 변수를 만들어서 소숫점 두자리로 만들고띄워야하나요??</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span></div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>방법이 있다면 문법이어떻게되나요?</div> <div><br></div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>도와주세요</div> <div><br></div> <div>/*</div> <div> * To change this license header, choose License Headers in Project Properties.</div> <div> * To change this template file, choose Tools | Templates</div> <div> * and open the template in the editor.</div> <div> */</div> <div><br></div> <div>package assignment01;</div> <div><br></div> <div>import javax.swing.JOptionPane;</div> <div><br></div> <div>/**</div> <div> *</div> <div> * @author CHOL HYUN PARK</div> <div> */</div> <div>public class Assignment01 {</div> <div> </div> <div> public static void main(String[] args) {</div> <div> double principal, rate, term, monthlyPayment;</div> <div> String p,r,t, mp;</div> <div> </div> <div> p = JOptionPane.showInputDialog("Enther Principal ");</div> <div> t = JOptionPane.showInputDialog("Enter term in years ");</div> <div> r = JOptionPane.showInputDialog("Enter rate in percent ");</div> <div> </div> <div> principal = Double.parseDouble(p);</div> <div> term = Double.parseDouble(t);</div> <div> rate = Double.parseDouble(r);</div> <div> </div> <div> term *= 12 ;</div> <div> rate /= 1200 ;</div> <div> </div> <div> monthlyPayment = principal*rate/(1.0-Math.pow(rate+1, -term));</div> <div> </div> <div> /*</div> <div><b> System.out.print("Your monthly payment is ");</b></div> <div><b> System.out.printf("%1$.2f", monthlyPayment); // setpercision 2</b></div> <div><b> System.out.print(" USD ");</b></div> <div><b> */ 요건 콘솔에뜨게</b></div> <div> </div> <div> //Display output</div> <div><b> JOptionPane.showMessageDialog(null, "Your monthly payment is " + monthlyPayment + " USD ", "Results",JOptionPane.PLAIN_MESSAGE); </b></div> <div><b>// 이건 팝업</b></div> <div> </div> <div> }//main method</div> <div> </div> <div>}// class Assignment01</div> <div><br></div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.