Created
August 5, 2015 23:44
-
-
Save KPCCoiL/0ed89df1a21b0c8dcb07 to your computer and use it in GitHub Desktop.
fx-clj version of ScalaFXHelloWorld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fxtest.core | |
(:require [fx-clj.core :as fx])) | |
(import (javafx.scene.paint Color LinearGradient Stop CycleMethod) | |
(javafx.geometry Insets) | |
(javafx.scene.effect DropShadow)) | |
(defn create-view [] | |
(fx/h-box | |
{:style "-fx-background-color: #000000" | |
:padding (Insets. 20)} | |
(fx/text {:text "Hello " | |
:style "-fx-font-size: 48pt" | |
:fill (LinearGradient. 0. 0. 0. 1. true CycleMethod/NO_CYCLE | |
(into-array [(Stop. 0 Color/PALEGREEN) (Stop. 1 Color/SEAGREEN)]))}) | |
(fx/text {:text "World!!!" | |
:style "-fx-font-size: 48pt" | |
:fill (LinearGradient. 0. 0. 0. 1. true CycleMethod/NO_CYCLE | |
(into-array [(Stop. 0 Color/CYAN) (Stop. 1 Color/DODGERBLUE)])) | |
:effect (fx/pset! (DropShadow.) | |
{:color Color/DODGERBLUE | |
:radius 25 | |
:spread 0.25})}))) | |
(defn -main [& args] | |
(fx/sandbox #'create-view :title "fx-clj Hello world")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment