JavaFX CSS styling π¨
Bro Code
@brocodezAbout
Coding bootcamps HATE HIM! πΏ
Latest Posts
Video Description
JavaFX CSS styling tutorial example explained #javafx #css #style //----------------------------Main.java----------------------------- package application; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; import javafx.scene.Parent; import javafx.scene.Scene; public class Main extends Application { @Override public void start(Stage stage) { try { Parent root = FXMLLoader.load(getClass().getResource("Main.fxml")); Scene scene = new Scene(root); //scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); String css = this.getClass().getResource("application.css").toExternalForm(); scene.getStylesheets().add(css); stage.setScene(scene); stage.show(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) { launch(args); } } //----------------------------application.css----------------------------- .root{ -fx-background-color: #111111; } .label{ -fx-font-size: 40; -fx-font-family: "Lucida Console"; -fx-text-fill: "white"; -fx-alignment: center; } #titleLabel{ -fx-font-size: 70; } //--------------------------------------------------------------------------------- Bro Code merch store π : =========================================================== https://teespring.com/stores/bro-code-5 =========================================================== music credits πΌ : =========================================================== Up In My Jam (All Of A Sudden) by - Kubbi https://soundcloud.com/kubbi Creative Commons β Attribution-ShareAlike 3.0 Unportedβ CC BY-SA 3.0 Free Download / Stream: http://bit.ly/2JnDfCE Music promoted by Audio Library https://youtu.be/tDexBj46oNI ===========================================================
You May Also Like
Elevate Your UI Game
AI-recommended products based on this video




















