I have a double type value that I call from another class named Account, and this value holds the balance
, of a user. Everytime a user click a button, I want to put it on display. Something like this :
The value (taken from class Account) should be located and presented below Your current balance(RM):
. But when I use the code below here, it won't even run the code.
Label balanceInfo = new Label("Your current balance (RM) :"+Double.toString(user[currentIndex].getBalance()));
The code only runs when I delete this part of the line : +Double.toString(user[currentIndex].getBalance())
I have also tried using +user[currentIndex].getBalance()
, and the code won't run.
So how do I make it so that it can show the value like 290.00
(double type) below the Label text Your current balance(RM):
?