Browse Source

fix:修复显示失败的bug;
- pendding=10的写法JDK23不支持
- 必须使用<padding><Insets top="10"/></padding>

yangyi 1 month ago
parent
commit
84f6a74a7f
1 changed files with 16 additions and 8 deletions
  1. 16 8
      client/src/main/resources/fxml/main.fxml

+ 16 - 8
client/src/main/resources/fxml/main.fxml

@@ -14,7 +14,8 @@
     <center>
         <TabPane>
             <Tab text="浏览书籍" closable="false">
-                <VBox spacing="10" padding="10">
+                <VBox spacing="10">
+                    <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                     <HBox spacing="10">
                         <TextField fx:id="searchField" promptText="搜索书名/作者..." HBox.hgrow="ALWAYS"/>
                         <ComboBox fx:id="categoryCombo" prefWidth="150"/>
@@ -47,7 +48,8 @@
                 </VBox>
             </Tab>
             <Tab text="我的交易" closable="false">
-                <VBox spacing="10" padding="10">
+                <VBox spacing="10">
+                    <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                     <Button text="刷新" onAction="#handleLoadTransactions"/>
                     <TableView fx:id="transTable" VBox.vgrow="ALWAYS">
                         <columns>
@@ -61,7 +63,8 @@
                 </VBox>
             </Tab>
             <Tab text="个人信息" closable="false">
-                <VBox spacing="12" padding="20" maxWidth="400">
+                <VBox spacing="12" maxWidth="400">
+                    <padding><Insets top="20" right="20" bottom="20" left="20"/></padding>
                     <Label text="个人信息"
                            style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
                     <HBox spacing="10"><Label text="用户名:" prefWidth="100"/><TextField fx:id="profileUsername" editable="false"/></HBox>
@@ -74,7 +77,8 @@
                 </VBox>
             </Tab>
             <Tab fx:id="sellerTab" text="卖家中心" closable="false">
-                <VBox spacing="10" padding="10">
+                <VBox spacing="10">
+                    <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                     <Label text="我的书籍" style="-fx-font-weight: bold;"/>
                     <Button text="刷新" onAction="#handleLoadMyBooks"/>
                     <TableView fx:id="myBookTable" VBox.vgrow="ALWAYS">
@@ -87,7 +91,8 @@
                     </TableView>
                     <Button text="删除选中" onAction="#handleDeleteBook"/>
                     <TitledPane text="添加新书" expanded="false">
-                        <GridPane hgap="10" vgap="8" padding="10">
+                        <GridPane hgap="10" vgap="8">
+                            <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                             <Label text="书名" GridPane.rowIndex="0" GridPane.columnIndex="0"/><TextField fx:id="newTitle" GridPane.rowIndex="0" GridPane.columnIndex="1"/>
                             <Label text="作者" GridPane.rowIndex="1" GridPane.columnIndex="0"/><TextField fx:id="newAuthor" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
                             <Label text="分类" GridPane.rowIndex="2" GridPane.columnIndex="0"/><TextField fx:id="newCategory" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
@@ -101,10 +106,12 @@
             </Tab>
             <Tab text="数据统计" closable="false">
                 <ScrollPane fitToWidth="true">
-                    <VBox spacing="15" padding="15">
+                    <VBox spacing="15">
+                        <padding><Insets top="15" right="15" bottom="15" left="15"/></padding>
                         <Button text="刷新数据" onAction="#handleLoadStatistics" maxWidth="200"/>
                         <TitledPane text="总览" expanded="true">
-                            <HBox spacing="40" padding="10">
+                            <HBox spacing="40">
+                                <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                                 <VBox spacing="5">
                                     <Label text="交易总金额" style="-fx-font-weight: bold;"/>
                                     <Label fx:id="statTotalAmount" text="-" style="-fx-font-size: 20px; -fx-text-fill: #27ae60;"/>
@@ -145,7 +152,8 @@
                 </ScrollPane>
             </Tab>
             <Tab fx:id="adminTab" text="管理" closable="false">
-                <VBox spacing="10" padding="10">
+                <VBox spacing="10">
+                    <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
                     <Label text="用户管理"
                            style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
                     <Button text="刷新用户" onAction="#handleLoadAllUsers"/>