Example #1
0
 /*
  * Updated the text within the title
  */
 public void update() {
   ArrayList<String> output = drinkServ.command("GETBALANCE");
   if (output.get(0).indexOf("ERR") == -1) {
     int balance = Integer.parseInt(output.get(0).split("\\s+")[1]);
     this.setText(
         "Drink App"
             + "\n Current User: "******"user", "null")
             + "\nCurrent Credits: "
             + balance);
   } else {
     this.setText("Drink App\nNo User Logged In");
   }
 }