diff --git a/src/main/java/seedu/address/ui/PersonCard.java b/src/main/java/seedu/address/ui/PersonCard.java index b9eb7e63c52..e9ecdc38d16 100644 --- a/src/main/java/seedu/address/ui/PersonCard.java +++ b/src/main/java/seedu/address/ui/PersonCard.java @@ -57,8 +57,12 @@ public PersonCard(Person person, int displayedIndex) { this.person = person; id.setText(displayedIndex + ". "); name.setText(person.getName().fullName); - phone.setText(person.getPhone().value); - email.setText(person.getEmail().value); + + StringBuilder truncatedPhone = new StringBuilder(); + phone.setText(truncatedPhone.append("Phone: ").append(person.getPhone().value).toString()); + + StringBuilder truncatedEmail = new StringBuilder(); + email.setText(truncatedEmail.append("Email: ").append(person.getEmail().value).toString()); String fullNote = person.getNote().value; int maxLineLength = 30; // Maximum length of each line before truncation @@ -93,7 +97,9 @@ public PersonCard(Person person, int displayedIndex) { ic.setText(person.getIdentityCardNumber().value); age.setText(String.valueOf(person.getAge().value)); sex.setText(person.getSex().value); - address.setText(person.getAddress().value); + + StringBuilder truncatedAddress = new StringBuilder(); + address.setText(truncatedAddress.append("Address: ").append(person.getAddress().value).toString()); person.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index a19a92f8cae..3594f7d7038 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -40,15 +40,12 @@