Space Out Tables

This commit is contained in:
2026-04-09 17:57:01 -06:00
parent da0c819da5
commit 56111f3ac7
6 changed files with 40 additions and 37 deletions

View File

@@ -174,6 +174,8 @@ public class PetController {
btnDelete.setDisable(true);
//Enable multiple selection
tvPets.getSelectionModel().setSelectionMode(javafx.scene.control.SelectionMode.MULTIPLE);
tvPets.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tvPets.setFixedCellSize(30);
colPetId.setCellValueFactory(new PropertyValueFactory<Pet,Integer>("petId"));
colPetImage.setCellValueFactory(new PropertyValueFactory<Pet, String>("imageUrl"));
@@ -380,7 +382,7 @@ public class PetController {
setGraphic(null);
return;
}
DesktopImageSupport.loadImageInto(imageView, item, 48, 48);
DesktopImageSupport.loadImageInto(imageView, item, 24, 24);
setGraphic(container);
}
});

View File

@@ -161,7 +161,7 @@ public class SaleController {
tvCart.setItems(cartItems);
tvCart.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
tvSales.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tvSales.setColumnResizePolicy(TableView.UNCONSTRAINED_RESIZE_POLICY);
tvSales.setFixedCellSize(34);
colSaleId.setCellValueFactory(new PropertyValueFactory<>("saleId"));
colSaleDate.setCellValueFactory(new PropertyValueFactory<>("saleDate"));

View File

@@ -50,6 +50,7 @@ public class ServiceController {
btnEdit.setDisable(true);
btnDelete.setDisable(true);
tvServices.getSelectionModel().setSelectionMode(javafx.scene.control.SelectionMode.MULTIPLE);
tvServices.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
colServiceId.setCellValueFactory(new PropertyValueFactory<>("serviceId"));
colServiceName.setCellValueFactory(new PropertyValueFactory<>("serviceName"));

View File

@@ -18,7 +18,7 @@
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<children>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
<children>
<Label text="Pets" textFill="#2c3e50">
<font>
@@ -83,19 +83,19 @@
</font>
</Label>
<TableView fx:id="tvPets" prefHeight="362.0" prefWidth="752.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colPetId" prefWidth="55.0" text="ID" />
<TableColumn fx:id="colPetImage" prefWidth="80.0" text="Image" />
<TableColumn fx:id="colPetName" prefWidth="110.0" text="Name" />
<TableColumn fx:id="colPetSpecies" prefWidth="105.0" text="Species" />
<TableColumn fx:id="colPetBreed" prefWidth="145.0" text="Breed" />
<TableColumn fx:id="colPetAge" prefWidth="60.0" text="Age" />
<TableColumn fx:id="colPetStatus" prefWidth="110.0" text="Status" />
<TableColumn fx:id="colPetPrice" prefWidth="80.0" text="Price" />
<TableColumn fx:id="colCustomerName" prefWidth="130.0" text="Owner" />
<TableColumn fx:id="colStoreName" prefWidth="130.0" text="Store" />
</columns>
</TableView>
<TableView fx:id="tvPets" prefHeight="362.0" prefWidth="980.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colPetId" prefWidth="55.0" text="ID" />
<TableColumn fx:id="colPetImage" prefWidth="60.0" text="Image" />
<TableColumn fx:id="colPetName" prefWidth="140.0" text="Name" />
<TableColumn fx:id="colPetSpecies" prefWidth="100.0" text="Species" />
<TableColumn fx:id="colPetBreed" prefWidth="170.0" text="Breed" />
<TableColumn fx:id="colPetAge" prefWidth="60.0" text="Age" />
<TableColumn fx:id="colPetStatus" prefWidth="100.0" text="Status" />
<TableColumn fx:id="colPetPrice" prefWidth="100.0" text="Price" />
<TableColumn fx:id="colCustomerName" prefWidth="160.0" text="Owner" />
<TableColumn fx:id="colStoreName" prefWidth="160.0" text="Store" />
</columns>
</TableView>
</children>
</VBox>

View File

@@ -162,16 +162,16 @@
</TextField>
</children>
</HBox>
<TableView fx:id="tvSales" prefHeight="270.0" style="-fx-background-color: white; -fx-background-radius: 12; -fx-padding: 2;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colSaleId" minWidth="48.0" prefWidth="52.0" text="ID" />
<TableColumn fx:id="colSaleDate" minWidth="115.0" prefWidth="140.0" text="Date" />
<TableColumn fx:id="colEmployeeName" minWidth="100.0" prefWidth="130.0" text="Employee" />
<TableColumn fx:id="colServiceProduct" minWidth="140.0" prefWidth="210.0" text="Product" />
<TableColumn fx:id="colSaleQuantity" minWidth="48.0" prefWidth="58.0" text="Qty" />
<TableColumn fx:id="colSaleUnitPrice" minWidth="75.0" prefWidth="92.0" text="Unit Price" />
<TableColumn fx:id="colSaleTotal" minWidth="78.0" prefWidth="96.0" text="Total" />
<TableColumn fx:id="colSalePaymentType" minWidth="76.0" prefWidth="90.0" text="Payment" />
<TableView fx:id="tvSales" prefHeight="270.0" prefWidth="1180.0" style="-fx-background-color: white; -fx-background-radius: 12; -fx-padding: 2;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colSaleId" minWidth="50.0" prefWidth="60.0" text="ID" />
<TableColumn fx:id="colSaleDate" minWidth="150.0" prefWidth="170.0" text="Date" />
<TableColumn fx:id="colEmployeeName" minWidth="150.0" prefWidth="160.0" text="Employee" />
<TableColumn fx:id="colServiceProduct" minWidth="260.0" prefWidth="320.0" text="Product" />
<TableColumn fx:id="colSaleQuantity" minWidth="55.0" prefWidth="70.0" text="Qty" />
<TableColumn fx:id="colSaleUnitPrice" minWidth="100.0" prefWidth="115.0" text="Unit Price" />
<TableColumn fx:id="colSaleTotal" minWidth="100.0" prefWidth="120.0" text="Total" />
<TableColumn fx:id="colSalePaymentType" minWidth="95.0" prefWidth="110.0" text="Payment" />
</columns>
</TableView>
</children>

View File

@@ -16,7 +16,7 @@
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<children>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
<children>
<Label text="Services" textFill="#2c3e50">
<font>
@@ -79,14 +79,14 @@
</font>
</Label>
<TableView fx:id="tvServices" prefHeight="362.0" prefWidth="752.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colServiceId" prefWidth="60.0" text="ID" />
<TableColumn fx:id="colServiceName" prefWidth="169.71432495117188" text="Name" />
<TableColumn fx:id="colServiceDesc" prefWidth="206.85711669921875" text="Description" />
<TableColumn fx:id="colServiceDuration" prefWidth="185.71429443359375" text="Duration (min)" />
<TableColumn fx:id="colServicePrice" prefWidth="129.14288330078125" text="Price" />
</columns>
</TableView>
<TableView fx:id="tvServices" prefHeight="362.0" prefWidth="980.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="colServiceId" prefWidth="60.0" text="ID" />
<TableColumn fx:id="colServiceName" prefWidth="210.0" text="Name" />
<TableColumn fx:id="colServiceDesc" prefWidth="420.0" text="Description" />
<TableColumn fx:id="colServiceDuration" prefWidth="150.0" text="Duration (min)" />
<TableColumn fx:id="colServicePrice" prefWidth="120.0" text="Price" />
</columns>
</TableView>
</children>
</VBox>