Children are modifiable
This commit is contained in:
parent
083f14a0a6
commit
f3659502b7
@ -12,17 +12,20 @@ package Launcher;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.shape.Rectangle;
|
||||
import javafx.scene.web.WebView;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public class Main extends Application {
|
||||
|
||||
public static final URL mainLauncher = Main.class.getResource("../assets/layout/main.fxml"); // Launcher body
|
||||
public static final URL homeTab = Main.class.getResource("../assets/layout/home.fxml"); // Launcher home tab
|
||||
|
||||
private double xOffset = 0, yOffset = 0; // Offsets for dragging
|
||||
private Button exit, min, Home_btn, Modpack_btn; // Define buttons
|
||||
private Rectangle dragBar; // Draggable top bar
|
||||
@ -31,7 +34,7 @@ public class Main extends Application {
|
||||
public void start(Stage primaryStage) throws Exception{
|
||||
|
||||
primaryStage.initStyle(StageStyle.UNDECORATED);
|
||||
Pane root = FXMLLoader.load(getClass().getResource("../assets/layout/Main_Launcher.fxml"));
|
||||
Pane root = FXMLLoader.load(mainLauncher);
|
||||
primaryStage.setTitle("Team-Avion Launcher [WIP]");
|
||||
primaryStage.setScene(new Scene(root, 900, 500));
|
||||
primaryStage.show();
|
||||
@ -49,7 +52,6 @@ public class Main extends Application {
|
||||
exit.setOnMouseClicked(event -> primaryStage.close());
|
||||
min.setOnMouseClicked(event -> primaryStage.setIconified(true));
|
||||
|
||||
|
||||
// Drag
|
||||
dragBar.setOnMousePressed(event -> {
|
||||
xOffset = event.getSceneX();
|
||||
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
|
||||
|
||||
<Button mnemonicParsing="false" text="Button" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1" />
|
@ -28,4 +28,4 @@
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</Pane>
|
||||
</Pane>
|
Loading…
x
Reference in New Issue
Block a user