20:13JavaFX CSS styling 🎨
From the creator
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 🎼 : ========================================================
Published 2021-01-04 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
20:13
09:21
02:01Introducing the Google Developer Program, Building with AI on Android updates, and more dev news!
Google for Developers
02:34What's new in Firebase, Flutter, and more Google I/O 2024 announcements
Google for Developers
05:53
16:28
20:14