108 lines
1.9 KiB
Java
108 lines
1.9 KiB
Java
package main.java.com.ThreeDtest.application;
|
|
|
|
import javafx.application.Application;
|
|
import javafx.event.ActionEvent;
|
|
import javafx.fxml.FXML;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.stage.Stage;
|
|
import javafx.scene.Scene;
|
|
import javafx.scene.control.Alert;
|
|
import javafx.scene.control.Alert.AlertType;
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.control.MenuItem;
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
public class Main extends Application
|
|
{
|
|
|
|
@FXML
|
|
private AnchorPane mainAnchorpane;
|
|
|
|
@FXML
|
|
private MenuItem menuItemStart;
|
|
|
|
@FXML
|
|
private MenuItem menuItemReset;
|
|
|
|
@FXML
|
|
private MenuItem menuItemClose;
|
|
|
|
@FXML
|
|
private MenuItem menuItemHilfe;
|
|
|
|
@FXML
|
|
private Button startStopButton;
|
|
|
|
@FXML
|
|
private Button resetButton;
|
|
|
|
@Override
|
|
public void start(Stage primaryStage)
|
|
{
|
|
try {
|
|
FXMLLoader loader = new FXMLLoader(
|
|
getClass().getResource("/fxml/MainWindow.fxml"));
|
|
AnchorPane pane = loader.load();
|
|
primaryStage.setTitle("jFx3Dtest");
|
|
Scene scene = new Scene(pane);
|
|
/**
|
|
* alle event listener mit fxml-loader
|
|
*
|
|
*/
|
|
scene.getStylesheets().add(
|
|
Main.class.getResource("/css/application.css").toExternalForm());
|
|
primaryStage.setScene(scene);
|
|
primaryStage.show();
|
|
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
@FXML
|
|
public void menuItemStartAction(ActionEvent event)
|
|
{
|
|
|
|
}
|
|
|
|
@FXML
|
|
public void menuItemResetAction(ActionEvent event)
|
|
{
|
|
|
|
}
|
|
|
|
@FXML
|
|
public void menuItemCloseAction(ActionEvent event)
|
|
{
|
|
System.exit(0);
|
|
}
|
|
|
|
@FXML
|
|
public void startStopButtonAction(ActionEvent event)
|
|
{
|
|
|
|
}
|
|
|
|
@FXML
|
|
public void resetButtonAction(ActionEvent event)
|
|
{
|
|
|
|
}
|
|
|
|
@FXML
|
|
public void menuItemHilfeAction(ActionEvent event)
|
|
{
|
|
Alert alert = new Alert(AlertType.INFORMATION);
|
|
alert.setTitle("Alert");
|
|
alert.setHeaderText("Some info");
|
|
alert.setContentText("Author: localhorst@mosad.xyz");
|
|
alert.showAndWait();
|
|
}
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
launch(args);
|
|
}
|
|
|
|
}
|