JavaFX CSS styling 🎨

preview_player
Показать описание
JavaFX CSS styling tutorial example explained

#javafx #css #style

package application;


public class Main extends Application {

@Override
public void start(Stage stage) {
try {
Scene scene = new Scene(root);
} catch(Exception e) {
}
}

public static void main(String[] args) {
launch(args);
}
}
.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 👟 :
===========================================================
===========================================================

music credits 🎼 :
===========================================================
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
===========================================================
Рекомендации по теме
Комментарии
Автор

Don't forget to smash that LIKE button 👍
and drop a random COMMENT down below for the YT algorithm!
💬

also here's the code from the video...


package application;

import
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 =
Scene scene = new Scene(root);

String css =

stage.setScene(scene);
stage.show();
} catch(Exception e) {
e.printStackTrace();
}
}

public static void main(String[] args) {
launch(args);
}
}

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Label?>
<?import

<children>
<Label fx:id="titleLabel" layoutY="105.0" prefHeight="17.0" prefWidth="600.0" text="Level 1" />
<Label fx:id="textLabel" layoutY="241.0" prefHeight="17.0" prefWidth="600.0" text="This is some CSS styling" />
</children>
</AnchorPane>

.root{
-fx-background-color:
}

.label{
-fx-font-size: 40;
-fx-font-family: "Lucida Console";
-fx-text-fill: "white";
-fx-alignment: center;
}

#titleLabel{
-fx-font-size: 70;
}

BroCodez
Автор

Lucky to have found you.
I‘ve never seen someone explaining things as good as you do.

Im still a beginner there are still a lot of things I don‘t unterstand.
Hope you will continue these Videos!

AlexAlex-roxp
Автор

One of the best YouTube-Channels I´ve ever seen!

tonalddrump
Автор

My interest in coding is increasing day by day because of u❣️

samnoob
Автор

Everything becomes so easy when you explain:) Thank you!🧡

alesto
Автор

thank you so much for sharing knowledge with us

adroaldoferreira
Автор

Yooo
I know this might not be the right place to say this, but I've been watching your videos for a while now, and I've been learning a great deal of things, more than what I'm learning from uni
You literally helped me complete some projects I had, and I can't thank you enough for the videos
I've been recommending your videos to some of my friends too
Keep up the great work!

jidelgado
Автор

That last trick of alignment was great. Thanks.

aldolunabueno
Автор

Thank you bro, you're one of the best JavafxBro 👍

energetic_deer
Автор

Note: I am using IntelliJ IDEA

I was able to get my CSS file to work by -> adding it to the resources folder and putting "/application.css" as the file path

PhantomGanhdi
Автор

you are single handedly saving my comuter science grade

suchithsunku
Автор

Your tutorials are truly amazing, thank you for your work sincerely!

tnczm
Автор

Thanks man, your commentary makes easier to understand aswell.

potatolover
Автор

Easy to understand your tutorials.Love the humour too 😂

felixnyamongo
Автор

I do really appreciate what you do and the way you teach

ChristianRodriguez-tmjg
Автор

de verdad si que disfruto del show aprendiendo en este canal, muy buen contenido :D

PsychoCrusher
Автор

Thank You :) I'm really enjoying this course. It's well thought out and I'm def inclined to finish ;) <3

remylebeau
Автор

This is a really awesome series! Thank you so much

TheGreat
Автор

thanks bro at first I had a little problem with where to put my file in intelij but I was later able to fix it

coderXplus
Автор

On eclipse:
-for fx-background-color i get unknown properties
- i applied a new font but i can't see it

aroundtheworldwithfootball