-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSavedGamePage.java
57 lines (50 loc) · 1.94 KB
/
SavedGamePage.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
package sample;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.MenuItem;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
public class SavedGamePage implements Initializable
{
@FXML private AnchorPane AnchorPaneMain;
@FXML private MenuItem Exit;
@FXML private MenuItem BackToMainMenu;
@FXML private TableView<GameElement> Table;
@FXML private TableColumn Column1;
@FXML private TableColumn Column2;
@FXML private TableColumn Column3;
public void ExitTheGame()
{
System.out.println("Exiting the game from saved Games Menu");
Stage stagemain = (Stage) AnchorPaneMain.getScene().getWindow();
stagemain.close();
}
public void BackToMainMenu() throws IOException {
System.out.println("Going to main menu from saved games menu");
Parent root= FXMLLoader.load(getClass().getResource("sample.fxml"));
AnchorPaneMain.getChildren().setAll(root);
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
// final ObservableList<GameElement> data= FXCollections.observableArrayList(
// new GameElement("Game1",10 , "load"),
// new GameElement("Game2", 15, "load")
// );
//
// Column1.setCellValueFactory(new PropertyValueFactory<GameElement, String>("GameID"));
// Column2.setCellValueFactory(new PropertyValueFactory<GameElement, Integer>("HighScore"));
// Column3.setCellValueFactory(new PropertyValueFactory<GameElement, String>("LoadButton"));
//
// Table.setItems(data);
}
}