Reputation: 3397
Since i declare:
double total = 12.00;
why i cant put:
p1.add(jlbTotal= new JLabel (total));
Is there any way I can use to insert that total value?
Upvotes: 0
Views: 2235
Reputation: 206747
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));
Upvotes: 5