Since i declare:
double total = 12.00;
why i cant put:
p1.add(jlbTotal= new JLabel (total));
Is there 开发者_如何学Pythonany way I can use to insert that total value?
JLabel
does not take doubles
in its constructors. You first need to convert your double
to a String
. For example:
new JLabel(String.valueOf(total));
精彩评论