hi people :WAVE:
im working on ATM class and i have a variable of type double named "amount"
i can display it like this "System.out.print( amount );"
but i want to display it using JOptionPane dialoge boxes.
What is the line to use? :confused:
Printable View
hi people :WAVE:
im working on ATM class and i have a variable of type double named "amount"
i can display it like this "System.out.print( amount );"
but i want to display it using JOptionPane dialoge boxes.
What is the line to use? :confused:
I suggest you check out the Sun tutorials on Swing.
Code:java.text.DecimalFormat df=new java.text.DecimalFormat("0.00");
JOptionPane.showMessageDialog(new Frame(),
"Amount: "+df.format(amount),
"Her it is",
JOptionPane.INFORMATION_MESSAGE);
try this,
JOptionPane.showMessageDialog ( "Amount is " +amount);
Thank you :D
It doesn't on 1.4...Quote:
Originally Posted by shivaprasad
yeh it will work on 1.4
i am using 1.4.2_07 version. it is working fine.
bye
shiva prasad.