0% found this document useful (0 votes)
5 views3 pages

Primary FXML

The document is an FXML file for a JavaFX application that outlines the layout for a budgeting and expenses tracker interface. It includes sections for budget goals with a progress bar, a pie chart for spending breakdown, and fields for entering expense details such as date, amount, category, and description. Action buttons for adding, updating, and deleting transactions, as well as navigation buttons, are also included in the layout.

Uploaded by

meiyingtham8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Primary FXML

The document is an FXML file for a JavaFX application that outlines the layout for a budgeting and expenses tracker interface. It includes sections for budget goals with a progress bar, a pie chart for spending breakdown, and fields for entering expense details such as date, amount, category, and description. Action buttons for adding, updating, and deleting transactions, as well as navigation buttons, are also included in the layout.

Uploaded by

meiyingtham8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

5/7/25, 9:43 PM primary.

fxml

src/main/resources/tham/seven/primary.fxml

1 <?xml version="1.0" encoding="UTF-8"?>


2
3 <?import javafx.geometry.Insets?>
4 <?import javafx.scene.control.Button?>
5 <?import javafx.scene.control.CheckBox?>
6 <?import javafx.scene.control.Label?>
7 <?import javafx.scene.control.TextField?>
8 <?import javafx.scene.image.Image?>
9 <?import javafx.scene.image.ImageView?>
10 <?import javafx.scene.layout.ColumnConstraints?>
11 <?import javafx.scene.layout.GridPane?>
12 <?import javafx.scene.layout.HBox?>
13 <?import javafx.scene.layout.RowConstraints?>
14 <?import javafx.scene.layout.VBox?>
15 <?import javafx.scene.chart.PieChart?>
16 <?import javafx.scene.layout.AnchorPane?>
17 <?import javafx.scene.control.ProgressBar?>
18
19 <HBox alignment="CENTER" prefHeight="700" prefWidth="1000" spacing="40" xmlns="http://javafx.com/javafx/23.0.1"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="tham.seven.PrimaryController" style="-fx-background-color:
#f4f4f4;">
20 <padding>
21 <Insets bottom="30" left="30" right="30" top="30"/>
22 </padding>
23
24 <!-- Left side -->
25 <VBox alignment="TOP_CENTER" spacing="30" prefWidth="500">
26 <!-- Budget Section -->
27 <VBox alignment="TOP_LEFT" spacing="15" prefWidth="400" style="-fx-background-color: #ffffff; -fx-
background-radius: 12; -fx-padding: 20; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.08), 10, 0, 0, 5);">
28 <Label text=" 💰
Budget Goals" style="-fx-font-size: 20px; -fx-font-weight: bold;" />
29 <ProgressBar fx:id="budgetProgressBar" prefWidth="360" style="-fx-accent: #4caf50;" />
30 <Label fx:id="budgetLabel" text="Budget: $0.00" style="-fx-text-fill: #444;" />
31 <Label fx:id="totalSpentLabel" text="Total Spent: $0.00" style="-fx-text-fill: #444;" />
32 <Label fx:id="remainingBudgetLabel­
" text="Remaining: $0.00" style="-fx-text-fill: #444;" />
33 </VBox>

localhost:62762/66df8eaf-9441-4892-9764-552ad28f836c/ 1/3
5/7/25, 9:43 PM primary.fxml
34
35 <!-- Pie Chart -->
36 <Label text=" 📊
Spending Breakdown" style="-fx-font-size: 20px; -fx-font-weight: bold;" />
37 <PieChart fx:id="pieChart" prefWidth="400" prefHeight="400" style="-fx-background-color: transparent;" />
38 </VBox>
39
40 <!-- Right side -->
41 <VBox alignment="TOP_CENTER" spacing="20" prefWidth="480" style="-fx-background-color: #ffffff; -fx-background-
radius: 12; -fx-padding: 25; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.08), 10, 0, 0, 5);">
42 <Label text=" 📘
Expenses Tracker" style="-fx-font-size: 22px; -fx-font-weight: bold;" />
43
44 <GridPane hgap="15" vgap="15" style="-fx-alignment: CENTER;">
45 <Label text="Date:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
46 <TextField fx:id="dateField" prefWidth="220" GridPane.columnIndex="1" GridPane.rowIndex="0" style="-fx-
background-radius: 8;" />
47
48 <Label text="Amount:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
49 <TextField fx:id="amountField" prefWidth="220" GridPane.columnIndex="1" GridPane.rowIndex="1" style="-
fx-background-radius: 8;" />
50
51 <Label text="Category:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
52 <TextField fx:id="categoryField" prefWidth="220" GridPane.columnIndex="1" GridPane.rowIndex="2" style="-
fx-background-radius: 8;" />
53
54 <Label text="Description:" GridPane.columnIndex="0" GridPane.rowIndex="3" />
55 <TextField fx:id="descriptionField" prefWidth="220" GridPane.columnIndex="1" GridPane.rowIndex="3"
style="-fx-background-radius: 8;" />
56
57 <Label text="In Budget:" GridPane.columnIndex="0" GridPane.rowIndex="4" />
58 <CheckBox fx:id="inBudgetCheckBox" GridPane.columnIndex="1" GridPane.rowIndex="4" />
59
60 <Button text=" 🗓️
New Month" onAction="#startNewMonth" style="-fx-background-radius: 8; -fx-background-
color: #ff9800; -fx-text-fill: white;" />
61
62
63 <columnConstraints>
64 <ColumnConstraints />
65 <ColumnConstraints />
66 </columnConstraints>
localhost:62762/66df8eaf-9441-4892-9764-552ad28f836c/ 2/3
5/7/25, 9:43 PM primary.fxml
67
68 </GridPane>
69
70 <!-- Action Buttons -->
71 <HBox alignment="CENTER" spacing="15">
72 <Button fx:id="addButton" text=" ➕
Add" onAction="#handleAddTransaction­
" style="-fx-background-radius:
8; -fx-background-color: #4caf50; -fx-text-fill: white;" />
73 <Button fx:id="updateButton" text=" ✏️
Update" onAction="#updateTransaction" style="-fx-background-
radius: 8; -fx-background-color: #2196f3; -fx-text-fill: white;" />
74 <Button fx:id="deleteButton" text=" 🗑️
Delete" onAction="#deleteTransaction" style="-fx-background-
radius: 8; -fx-background-color: #f44336; -fx-text-fill: white;" />
75 </HBox>
76
77 <!-- Navigation Buttons -->
78 <HBox alignment="CENTER" spacing="10">
79 <Button fx:id="firstButton" onAction="#firstTransaction" prefWidth="40" text="⏮" style="-fx-background-
radius: 5;" />
80 ⏪
<Button fx:id="prev2Button" onAction="#prevTransaction" prefWidth="40" text=" " style="-fx-background-
radius: 5;" />
81 <Button fx:id="prevButton" onAction="#prevTransaction" prefWidth="40" text="◀" style="-fx-background-
radius: 5;" />
82 <Button fx:id="nextButton" onAction="#nextTransaction" prefWidth="40" text="▶" style="-fx-background-
radius: 5;" />
83 ⏩
<Button fx:id="next2Button" onAction="#nextTransaction" prefWidth="40" text=" " style="-fx-background-
radius: 5;" />
84 <Button fx:id="lastButton" onAction="#lastTransaction" prefWidth="40" text="⏭" style="-fx-background-
radius: 5;" />
85 </HBox>
86 </VBox>
87 </HBox>
88

localhost:62762/66df8eaf-9441-4892-9764-552ad28f836c/ 3/3

You might also like