Space Out Tables

This commit is contained in:
2026-04-09 17:57:01 -06:00
parent 0b25e0422a
commit 793053a621
6 changed files with 40 additions and 37 deletions

View File

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

View File

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

View File

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

View File

@@ -83,18 +83,18 @@
</font> </font>
</Label> </Label>
<TableView fx:id="tvPets" prefHeight="362.0" prefWidth="752.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS"> <TableView fx:id="tvPets" prefHeight="362.0" prefWidth="980.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns> <columns>
<TableColumn fx:id="colPetId" prefWidth="55.0" text="ID" /> <TableColumn fx:id="colPetId" prefWidth="55.0" text="ID" />
<TableColumn fx:id="colPetImage" prefWidth="80.0" text="Image" /> <TableColumn fx:id="colPetImage" prefWidth="60.0" text="Image" />
<TableColumn fx:id="colPetName" prefWidth="110.0" text="Name" /> <TableColumn fx:id="colPetName" prefWidth="140.0" text="Name" />
<TableColumn fx:id="colPetSpecies" prefWidth="105.0" text="Species" /> <TableColumn fx:id="colPetSpecies" prefWidth="100.0" text="Species" />
<TableColumn fx:id="colPetBreed" prefWidth="145.0" text="Breed" /> <TableColumn fx:id="colPetBreed" prefWidth="170.0" text="Breed" />
<TableColumn fx:id="colPetAge" prefWidth="60.0" text="Age" /> <TableColumn fx:id="colPetAge" prefWidth="60.0" text="Age" />
<TableColumn fx:id="colPetStatus" prefWidth="110.0" text="Status" /> <TableColumn fx:id="colPetStatus" prefWidth="100.0" text="Status" />
<TableColumn fx:id="colPetPrice" prefWidth="80.0" text="Price" /> <TableColumn fx:id="colPetPrice" prefWidth="100.0" text="Price" />
<TableColumn fx:id="colCustomerName" prefWidth="130.0" text="Owner" /> <TableColumn fx:id="colCustomerName" prefWidth="160.0" text="Owner" />
<TableColumn fx:id="colStoreName" prefWidth="130.0" text="Store" /> <TableColumn fx:id="colStoreName" prefWidth="160.0" text="Store" />
</columns> </columns>
</TableView> </TableView>
</children> </children>

View File

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

View File

@@ -79,13 +79,13 @@
</font> </font>
</Label> </Label>
<TableView fx:id="tvServices" prefHeight="362.0" prefWidth="752.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS"> <TableView fx:id="tvServices" prefHeight="362.0" prefWidth="980.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
<columns> <columns>
<TableColumn fx:id="colServiceId" prefWidth="60.0" text="ID" /> <TableColumn fx:id="colServiceId" prefWidth="60.0" text="ID" />
<TableColumn fx:id="colServiceName" prefWidth="169.71432495117188" text="Name" /> <TableColumn fx:id="colServiceName" prefWidth="210.0" text="Name" />
<TableColumn fx:id="colServiceDesc" prefWidth="206.85711669921875" text="Description" /> <TableColumn fx:id="colServiceDesc" prefWidth="420.0" text="Description" />
<TableColumn fx:id="colServiceDuration" prefWidth="185.71429443359375" text="Duration (min)" /> <TableColumn fx:id="colServiceDuration" prefWidth="150.0" text="Duration (min)" />
<TableColumn fx:id="colServicePrice" prefWidth="129.14288330078125" text="Price" /> <TableColumn fx:id="colServicePrice" prefWidth="120.0" text="Price" />
</columns> </columns>
</TableView> </TableView>
</children> </children>