This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATMSceneBuilder.java
58 lines (51 loc) · 1.91 KB
/
ATMSceneBuilder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Title: A becoming-Crazy ATM
Description:
This is a simple but not ordinary ATM, it will not usually meet user's needs correctly :)
During the program's process, I also print a lot to the console to check the program working
(in the console, there are program's status, user names and passwords, ...)
Author: Hai Nguyen
Version: v6
Last updated: 12:37 PM, April 12, 2016
List of features:
○ Manage bank accounts by read & write text file (user's infomation and statistics)
○ Create new accounts and save it to the same text file
○ Delete account after entering wrong password 3 times
○ Display & Edit user's information
○ Deposit & Withdraw money
○ Crazy Sound effect
○ "Security" questions
○ Coin or Cash withdraw
○ Open Browser with url
*/
package ATMjavafx;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/*
this class will
1. load user data from text file, create account objects and put them to an ArrayList
2. Enable an annoying background sound
3. Load the first Scene
*/
public class ATMSceneBuilder extends Application {
public static void main(String[] args) {launch(args);}
@Override public void start(Stage window) throws Exception {
//load user data
System.out.print("Loading user data ");
try {Account.loadUserData();}catch (Exception e) {}
System.out.println("finished.");
//Enable background sound
ATMjavafx.Sound.playBackgoundSound();
//go to the Login and Register options
window.setTitle("Hainguyen's ATM");
Parent root = FXMLLoader.load(getClass().getResource("fxml/A00_loginAndRegister.fxml"));
Scene scene1 = new Scene(root);
scene1.getStylesheets().add // CSS
(ATMSceneBuilder.class.getResource("MainStyle.css").toExternalForm());
window.setScene(scene1);
window.show();
}
}