-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCars.java
More file actions
56 lines (44 loc) · 1.2 KB
/
Copy pathCars.java
File metadata and controls
56 lines (44 loc) · 1.2 KB
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
package jfx;
import java.io.IOException;
//import java.util.ArrayList;
import java.util.Scanner;
//import java.io.File;
import java.io.FileInputStream;
//import java.io.FileNotFoundException;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class Cars extends btp400.a1.FinalStation{
@FXML
private Button back;
@FXML
private Button cars;
@FXML
private TextField displayArea;
@FXML
void backClicked(ActionEvent event) throws IOException {
Main m = new Main();
m.changeScene("MainPage.fxml");
}
@FXML
void carsClicked(ActionEvent event) {
String fInv = " " ;
try {
FileInputStream line = new FileInputStream("CarLog.txt");
Scanner sc = new Scanner(line);
while(sc.hasNextLine()) {
//System.out.println("\n");
System.out.println(sc.nextLine());
//fInv += sc.nextLine();
//displayArea.setText(sc.toString());
//displayArea.setText(sc.nextLine());
}
sc.close();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}