Update GUI
This commit is contained in:
@@ -3,7 +3,7 @@ package greenify.client.controller;
|
||||
import greenify.client.rest.UserService;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -25,10 +25,10 @@ public class DashBoardController {
|
||||
private AnchorPane activitiesPane;
|
||||
|
||||
@FXML
|
||||
private TextField counter;
|
||||
private Label veganMealCounter;
|
||||
|
||||
@FXML
|
||||
private TextField totalCount;
|
||||
private Label totalVeganMealCounter;
|
||||
|
||||
/**
|
||||
* displays the dashboard pane.
|
||||
@@ -46,7 +46,7 @@ public class DashBoardController {
|
||||
* @param event the event (clicking the button)
|
||||
*/
|
||||
public void displayActivities(ActionEvent event) {
|
||||
totalCount.setText("Total Count: " + userService.currentUser.getVeganMeal());
|
||||
totalVeganMealCounter.setText("" + userService.currentUser.getVeganMeal());
|
||||
System.out.println("display activities");
|
||||
dashboardPane.setVisible(false);
|
||||
userPane.setVisible(false);
|
||||
@@ -71,11 +71,11 @@ public class DashBoardController {
|
||||
public void addVeganMeal(ActionEvent event) {
|
||||
count++;
|
||||
int net = userService.currentUser.getVeganMeal() + count;
|
||||
totalCount.setText("Total Count: " + net);
|
||||
counter.setText("Count: " + count);
|
||||
totalVeganMealCounter.setText("" + net);
|
||||
veganMealCounter.setText("" + count);
|
||||
System.out.println(userService);
|
||||
userService.addVeganMeal(userService.currentUser.getId(),
|
||||
userService.currentUser.getName());
|
||||
userService.currentUser.getName());
|
||||
System.out.println("Vegetarian meal is added");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user