Advertisement
Guest User

NuBotAppRunner.java

a guest
Sep 15th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.78 KB | None | 0 0
  1. package com.cottonlesergal.nubot.app;
  2.  
  3. import animatefx.animation.FadeIn;
  4. import com.cottonlesergal.nubot.bot.BotRunner;
  5. import com.cottonlesergal.nubot.main.modules.DebugPrinter;
  6. import javafx.application.Application;
  7. import javafx.fxml.FXMLLoader;
  8. import javafx.scene.Parent;
  9. import javafx.scene.Scene;
  10. import javafx.scene.image.Image;
  11. import javafx.scene.paint.Color;
  12. import javafx.scene.text.Font;
  13. import javafx.stage.Stage;
  14. import javafx.stage.StageStyle;
  15.  
  16. import java.net.InetAddress;
  17.  
  18. public class NuBotAppRunner extends Application {
  19.  
  20.  
  21.     @Override
  22.     public void start(Stage stage) throws Exception{
  23.  
  24.         DebugPrinter debug = new DebugPrinter();
  25.         FXMLLoader loader = new FXMLLoader();
  26.         loader.setLocation(getClass().getResource("/scenes/Menu.fxml"));
  27.         Parent root = loader.load();
  28.         stage.initStyle(StageStyle.TRANSPARENT);
  29.         Scene scene = new Scene(root);
  30.         scene.setFill(Color.TRANSPARENT);
  31.         stage.setScene(scene);
  32.         stage.setTitle("NuBot");
  33.         stage.show();
  34.         stage.getIcons().add(new Image(this.getClass().getResourceAsStream("/media/images/logos/whiterivfurlogo.png")));
  35.         scene.getStylesheets().add(getClass().getResource("/media/files/css/app.css").toExternalForm());
  36.         Font.loadFont(
  37.                 NuBotAppRunner.class.getResource("/media/files/fonts/UniSansDemoHeavyCAPS.otf").toExternalForm(),
  38.                 10
  39.         );
  40.         stage.show();
  41.         debug.println("Host Name: " + InetAddress.getLocalHost().toString().split("/")[0]);
  42.         debug.println("Host Address: " + InetAddress.getLocalHost().toString().split("/")[1]);
  43.         new FadeIn(root).play();
  44.     }
  45.  
  46.     public static void main(String[] args) {
  47.         new BotRunner();
  48.         launch(args);
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement