Some JavaFX project code I just Made for Warm-Up!

3 days ago
4

Below is the complete JavaFX project code that will display your song lyrics with interactive features and embedded CSS styling. Make sure you have JavaFX set up in your development environment before running the code.

```java
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import java.util.Random;

public class EpicSongDisplay extends Application {

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

@Override
public void start(Stage primaryStage) {
VBox root = new VBox(10);
root.setStyle("-fx-padding: 20px; -fx-background-color: #282c34; -fx-alignment: center;");

String[] verses = {
"Join us, join us, in the digital realm we convene,",
"#whatEverisLeftofPersians, where visions are keen.",
"In the halls of Clubhouse, our voices unite,",
"Under the banner of Zoroaster, we ignite.",
"In the #Zoroaster_Worldview_Foundation we stand,",
"بنیاد جهان-بینی زرتشت, guiding hand.",
"Ancient wisdom from Avesta to Gathas we hold,",
"A project ongoing, new truths to unfold.",
"Our current teacher, Sensei, a beacon so bright,",
"Reach him on Telegram, in the ethereal night.",
"https://t.me/kianshahbazian, questions answered with grace,",
"In the digital realm, wisdom finds its place.",
"To direct your queries, to reach me with care,",
"https://t.me/rezatadious, where thoughts we share.",
"SMS me with caution, let your voice be clear,",
"+989392333086, connections we hold dear.",
"In a world transparent, honesty reigns,",
"+989157082678, where truth sustains.",
"+989029031841, a line to the heart,",
"Save +989332220298, though its silence may impart.",
"The main SIM card, a lifeline unseen,",
"+989916236082, messages convene.",
"Transparent as daylight, true and real,",
"In the realm of numbers, connections we feel.",
"On YouTube, a journey unfolds,",
"https://www.youtube.com/watch?v=-SokJyLlnNs, knowledge of old.",
"Subscribe to the channel, let understanding grow,",
"https://www.youtube.com/@Bonyadjahanbinizartosht, let wisdom flow.",
"On #Telegram, our quest continues,",
"https://t.me/jahanbini_Zartosht, where minds renew.",
"In the digital realm, we gather as one,",
"In the light of Zoroaster, our journey begun.",
"Google Translate whispers words profound,",
"Iranian culture, where pride is found.",
"فرهنگ ایرانی، راهکار سرافرازی, it sings,",
"In every heartbeat, our heritage springs.",
"Our culture, a mantle of pride,",
"When lived each moment, it’s a joyous ride.",
"Not just in words, but in actions we show,",
"In Iran’s culture, our spirits glow.",
"I continue this tale, a narrative grand,",
"With #2nd comment, let’s take a stand.",
"Through digital waves, our voices rise,",
"In unity and culture, our future lies.",
"Copy and preserve, our legacy we guard,",
"Against adversaries, we stand ever hard.",
"Facing extremism, we rise with might,",
"In the truth of our mission, we find our light.",
"In a world of chaos, a virus we see,",
"Neutralize the threat, set minds free.",
"Not a new religion, but truth we reveal,",
"In the heart of wisdom, our spirits heal.",
"Atheists we are, yet believers in truth,",
"In the legacy of wisdom, we find our youth.",
"Against extremism, our voices we raise,",
"In the light of knowledge, we find praise.",
"Visit our channels, where voices are clear,",
"t.me/illumiamedia, where truth we hold dear.",
"facebook.com/Reza.TDS, where stories unfold,",
"instagram.com/illumia_light_array, tales of old.",
"On Rumble and Clubhouse, our journey extends,",
"rumble.com/user/rezatadious/videos, where wisdom transcends.",
"clubhouse.com/@skyfiredll, conversations ignite,",
"In the digital realm, we find our light.",
"Three accounts on Clubhouse, voices set free,",
"https://www.clubhouse.com/@rezatadious, join and see.",
"https://www.clubhouse.com/@truthkast, where truth takes flight,",
"In the foundation of wisdom, we find might.",
"Here's a link to a video, a journey through time,",
"https://www.youtube.com/watch?v=55InLTOzbo0/, a visual rhyme.",
"Covering the 17 Gathas, scroll and see,",
"In the silence and darkness, growth like the tree.",
"Like Venom and Eddie, or Naruto and Kurama,",
"In silence and darkness, our spirits find drama.",
"Magic mushrooms teach us, wisdom unfolds,",
"In the depths of silence, our courage holds.",
"Remind me to write, an essay profound,",
"On Psilocybin, Pineal Gland, wisdom unbound.",
"N,N-Dimethyltryptamine, secrets to share,",
"In the world of knowledge, we find our care.",
"Watch the video, again and again,",
"https://www.youtube.com/watch?v=55InLTOzbo0/, wisdom’s refrain.",
"Even if it’s your fifth or sixth time through,",
"In the light of learning, we find the new.",
"Hashtags to follow, a map of our quest,",
"#drKhosrowPardis, where wisdom is best.",
"#TheRenaissanceofZarathustrainIran, a call,",
"#theAryanLandofIran, where legends enthral.",
"#ourCommonPersian_ID, identity found,",
"#thePersianIdentityRevival, where roots abound.",
"#Zoroaster_Worldview_Foundation, a guiding light,",
"#theZoroasterWorldviewFoundation, in the night.",
"#BonyadJahanbiniZartosht, wisdom’s embrace,",
"#Bonyad_Jahanbini_Zartosht, a sacred space.",
"Join us in this journey, where dreams align,",
"In the culture of Iran, our spirits entwine.",
"Listen to us, #whatEverisLeftofTruePersians, unite,",
"In Bonyad Jahanbini Zartosht, we find our light.",
"Reza G. and friends, a foundation strong,",
"From an SM-A032FXX, we sing our song.",
"In Android’s embrace, with custom flair,",
"Securing the weak, a journey rare.",
"6:33 AM, December’s dawn,",
"In the heart of Iran, a new day is born.",
"My IG, a portal to connect,",
"https://www.instagram.com/illumia_light_array/ to reflect.",
"Message this account, where stories unfold,",
"In the digital tapestry, narratives told.",
"On Rumble, a call to listen and see,",
"https://rumble.com/register/rezatadious, join the spree.",
"Direct link to wisdom, where stories align,",
"https://rumble.com/v5x5lnn-listen-to-whateverisleftoftruepersians-in-here-bonyad-jahanbini-zartosht.html, where thoughts intertwine.",
"Embedded in code, our message extends,",
"In digital realms, where understanding transcends.",
"In the network's embrace, our voices are heard,",
"In the language of code, our message is stirred.",
"In the digital world, our voices unite,",
"In the foundation of Zoroaster, we find our might.",
"With every message sent, a connection we build,",
"In the culture of Iran, our hearts are thrilled.",
"Join us in this epic, where history meets now,",
"In the foundation of Zoroaster, we take a vow.",
"With wisdom and courage, we pave the way,",
"In the culture of Iran, we proudly stay.",
"In the threads of time, our legacy we weave,",
"In the foundation of our ancestors, we believe.",
"With every word spoken, our culture we embrace,",
"In the digital realm, we find our place.",
"Join us in this journey, where knowledge is key,",
"In the foundation of Zoroaster, we are free.",
"With every link and number, a bond we create,",
"In the culture of Iran, we celebrate.",
};

Random random = new Random();

for (String verse : verses) {
Label label = new Label(verse);
label.setFont(Font.font("Arial", 18));
label.setTextFill(Color.WHITE);

label.setOnMouseEntered(e -> {
label.setScaleX(1.2);
label.setScaleY(1.2);
label.setTextFill(Color.web(randomColor()));
label.setEffect(new DropShadow(20, Color.web(randomColor())));
});

label.setOnMouseExited(e -> {
label.setScaleX(1);
label.setScaleY(1);
label.setTextFill(Color.WHITE);
label.setEffect(null);
});

root.getChildren().add(label);
}

Scene scene = new Scene(root, 800, 600);
primaryStage.setScene(scene);
primaryStage.setTitle("Epic Song Display");
primaryStage.show();
}

private String randomColor() {
Random random = new Random();
return String.format("#%02X%02X%02X", random.nextInt(256), random.nextInt(256), random.nextInt(256));
}
}
```

### How to Run This Code:
1. **JavaFX Setup**: Ensure that JavaFX is configured in your development environment. You might need to download the JavaFX SDK and set up your IDE (like IntelliJ IDEA or Eclipse) to include it.

2. **Compile and Run**: Copy the code into a Java file named `EpicSongDisplay.java`. Compile and run it using your IDE or command line tools configured with JavaFX.

3. **Interact**: As you hover over the text, it will enlarge, change color, and display a drop shadow, giving a dynamic interactive experience.

Loading 3 comments...