diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java index fd5ffa7..8a9739d 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/PropertyOverviewMenu.java @@ -18,8 +18,11 @@ import pp.monopoly.model.fields.FoodField; import pp.monopoly.model.fields.GateField; import pp.monopoly.model.fields.PropertyField; +import java.text.Collator; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; /** * PropertyOverviewMenu is a dialog for displaying the player's properties in the game. @@ -102,7 +105,7 @@ public class PropertyOverviewMenu extends Dialog { } // Iterate through the fetched properties - for (PropertyField property : fields) { + for (PropertyField property : fields.stream().sorted(Comparator.comparingInt(PropertyField::getId)).collect(Collectors.toList())) { if (property instanceof BuildingProperty) { BuildingProperty building = (BuildingProperty) property; cards.add(createBuildingCard(building));