https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
tornadofx
  • n

    nimakro

    04/20/2020, 5:59 AM
    @Dominaezzz Scene builder only works with fxml as far as I know...I started to add similar functionality as Scene builder to the tfx-plugin a while back but currently I don't have any spare time to continue the work on it...So currently your best bet to preview the view is to run only that view from intellij or run the hole app with hot-reloading enabled
    👍 2
    d
    • 2
    • 7
  • d

    Dustyn

    04/20/2020, 9:29 AM
    Hey, did anybody have tried out to add background color to a text in a textflow ? i dont see a easy option for that...
    • 1
    • 2
  • t

    thanerian

    04/20/2020, 12:12 PM
    Hi, anyone archive set stage height at runtime based on childen size, in my example I have a ObservableList of items, that could be removed/added, and based on that list I add/remove childrens inside a VBox
    d
    • 2
    • 9
  • t

    thanerian

    04/21/2020, 7:52 AM
    I checked FontAwesomeFx but i cannot see how implmenet
    -icon-color
    property using css DSL of tornadofx
    • 1
    • 2
  • p

    Pedro González

    04/21/2020, 8:29 AM
    Continuing the trend of possibly dummy, definitely noobish questions, does tornado have any helper for enabling and controlling drag 'n drop behaviour?
    d
    • 2
    • 2
  • d

    Dustyn

    04/21/2020, 8:50 AM
    Any opinions about using today a in-memory backing databse for an offline-online-app ?
    t
    • 2
    • 1
  • t

    thanerian

    04/21/2020, 12:25 PM
    It’s possible that when open a View via openWindow() when press a button, if pressed again, instead of create a second view and window, gain focus the first one?
    d
    • 2
    • 1
  • d

    Dustyn

    04/21/2020, 1:39 PM
    Hey guys, in case somebody wanted to try out an example project with RxJava and a embedded sqlLite database Thomas Nield has built a nice demo application - i just fixed the dependencies and made it running with TornadoFX2.0 and Java13 and Gradle 6.1 with Kotlin-DSL .. i requested a pull-merge but meanwhile if somebody is interesested -> https://github.com/deggers/rxkotlinfx-tornadofx-demo
    t
    • 2
    • 1
  • p

    Pedro González

    04/21/2020, 2:36 PM
    Any idea why following the guide on tableviews, thw column() builder would make the ide unable to pick an overload?
    d
    • 2
    • 8
  • t

    thanerian

    04/21/2020, 2:58 PM
    I see lot of outdated repos across github that use javafx
    d
    a
    • 3
    • 5
  • b

    brian

    04/22/2020, 10:09 AM
    I realize am getting a the previous details when I click to add new details in the Workspace class create button
    d
    • 2
    • 1
  • t

    thanerian

    04/22/2020, 1:54 PM
    other classes get resolved correctly? check IntelliJ dependencies and check that tornado is present
    b
    • 2
    • 3
  • p

    Pedro González

    04/22/2020, 3:09 PM
    Within a Tableview cellformat, is there a way to get a reference to the itwm from where de data is displayed? (In the examples of the guide, get a reference to the Person)? Also, is there a something like a rowFormat, which would apply the sam format to all cells in the same row?
    d
    • 2
    • 10
  • l

    Lilly

    04/23/2020, 12:19 AM
    Hi, I like Kotlin and I would like to create a desktop app for Windows. Is it possible to access the Windows API with kotlin/tornadofx in any way?
    s
    a
    • 3
    • 3
  • d

    Dustyn

    04/23/2020, 8:47 AM
    Hi - Question. I have a ViewItemModel with a StringProperty. Now when i open a new window and inject exactly this ViewItemModel there, i see the actual value in the textfield. The commit and rollback functionalty is as well working. When i commit from the new window, the change is also in the old window. But i get an exception thrown that "java.lang.RuntimeException: A bound value cannot be set." I guess thats something javafx specific..?
    • 1
    • 1
  • v

    ValV

    04/23/2020, 2:15 PM
    What Debain (Stretch) packages I'm missing for the following libraries:
    jre/lib/amd64/libavplugin-53.so
    jre/lib/amd64/libavplugin-54.so
    jre/lib/amd64/libavplugin-55.so
    jre/lib/amd64/libavplugin-56.so
    jre/lib/amd64/libavplugin-57.so
    jre/lib/amd64/libavplugin-ffmpeg-56.so
    jre/lib/amd64/libavplugin-ffmpeg-57.so
    jre/lib/amd64/libbci.so
    jre/lib/amd64/libdcpr.so
    jre/lib/amd64/libdeploy.so
    jre/lib/amd64/libglassgtk2.so
    jre/lib/amd64/libglassgtk3.so
    jre/lib/amd64/libglib-lite.so
    jre/lib/amd64/libjavafx_font_t2k.so
    jre/lib/amd64/libjfr.so
    jre/lib/amd64/libjpeg.so
    jre/lib/amd64/liblcms.so
    jre/lib/amd64/libnpjp2.so
    jre/lib/amd64/libresource.so
    jre/lib/amd64/libt2k.so
    Looks like incomplete JavaFX installation (I'm running OpenJFX)?
    d
    • 2
    • 6
  • d

    Dustyn

    04/24/2020, 3:26 PM
    Is anybody running tornadofx directly from gradle? i run into module problems somehow
    d
    • 2
    • 2
  • d

    Dominaezzz

    04/24/2020, 4:04 PM
    Has anyone else gotten DDos'd by this? https://github.com/edvin/tornadofx/wiki/Error-Handler#error-handler
    d
    n
    • 3
    • 5
  • d

    Dustyn

    04/25/2020, 4:11 PM
    Anybody an idea how i preserve my selection state from a treeView between "docks" from the workspaces? I though i could get the selectionModel in the cellDecorater and then select the vlaue which lies in my item from the ItemViewModel - but this doesnt works out.. or could it be the decorater ? I got a "master/detail" setup and in both docks the "master" is the treeView .. from the detail i know that the ItemViewModel contains the correct value - just
    selectionModel.select(TreeItem(treeNodeViewModel.item))
    does not seelct the item .. the item itself has an autogenerated UUID on which the equals method checks against - or should. My TreeView itself is a fragment and i open the dock via
    val master = find<ProjectStructureFragment>()
    val detail = find<ProjectStructureEditorView>()
    workspace.dock(MasterDetailView(master,detail))
    And because i use no where any scope - i should not need to use scope right? its everywhere the "default scope" i think In the MasterDetailView is again a Fragment actually which root is a splitpane and will add the two arguments It seems to me somehow i am not able to select the node again.. but if i got the implementation right, javafx will try to find the node based on the TreeNode.value But wenn i select Entry A in one Dock and Entry B in another, the selected values in the docks are saved when i go back and forth - so somehow it remembers the selectionState - but not from the ItemViewModel ?
    • 1
    • 1
  • d

    Dustyn

    04/25/2020, 7:46 PM
    And on another note..
    class MasterDetailView(master: UIComponent, detail: UIComponent) : Fragment() {..}
    i want to initate via the find method - i tried the following but that does not work like i expect it to work.. what am i missing?
    val master = find<ProjectStructureFragment>()
    val detail = find<ProjectStructureEditorView>()
    workspace.dock(find<MasterDetailView>("master" to master, "detail" to detail))
    Thanks in advance
    • 1
    • 1
  • p

    Pedro González

    04/27/2020, 9:17 AM
    Does anyone know of any library that facilitates the drawing of mindmaps/directed graphs?
    d
    • 2
    • 3
  • d

    Dominaezzz

    04/27/2020, 2:23 PM
    Has anyone used kotlinx.coroutine `Flow`s with JavaFX. In particular, converting them to `ObservableValue`s.
    d
    a
    • 3
    • 7
  • t

    thanerian

    04/27/2020, 3:44 PM
    https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/kotlinx-coroutines-rx2/README.md
    d
    a
    • 3
    • 9
  • v

    Vinicius Carvalho

    04/27/2020, 9:56 PM
    Hi folks trying to start a project on java11, and I read a bunch of posts on how to properly add openjavafx
    d
    • 2
    • 6
  • v

    Vinicius Carvalho

    04/28/2020, 12:36 PM
    Hi folks, trying to pass command line arguments to my main class. But
    launch<TornadoApplication>()
    give compilation error, as if my TornadoApplication class was not of type javafx.application.Application, even when I extend the App super class. Any ideas on why is this happening? On OpenJDK 13
    d
    • 2
    • 21
  • d

    Dustyn

    04/28/2020, 1:56 PM
    Does anybody has implemented or an idea how to make a filterable treeView ?
    • 1
    • 1
  • d

    Dominik wuttke

    04/30/2020, 12:05 AM
    Can someone help me to get tornadofx running? I am using IntelliJ and tried downloading the plugin from marketplace. When i create a project i get vcs root mapping error, when i remove this error, i got the problem that javafx can't be found. After that i got the problem, that the used gradle seems to be wrong. Is there any easier approach how to get tornadofx running? I don't know how many errors are there coming, as it seems that everytime i solve a problem I get another one.
    v
    t
    g
    • 4
    • 20
  • g

    Gabriel Sanmartin

    04/30/2020, 8:43 AM
    https://stackoverflow.com/questions/61487800/how-to-share-information-across-views-keep-global-state-in-tornadofx
    v
    • 2
    • 3
  • v

    Vinicius Carvalho

    04/30/2020, 9:41 PM
    Hum, seems like
    cellFormat
    is removing the graphics, if I remove that section I get the images for the category level, but then toString is called for
    EmulatorDownload
    types. Is there another way to customize the cellFormat to use either
    text
    or
    graphic
    ?
    d
    • 2
    • 1
  • v

    Vinicius Carvalho

    04/30/2020, 10:40 PM
    Wrapped all TreeItems on a
    NodePrinter
    (I'm horrible naming things) that either use toString or a custom
    (T) -> String
    function. For some items I override that callback to print the version property, others that are plain string with the image I let the TreeView print them with the graphic and text
    class NodePrinter<T>(val node: T, val callback: (T) -> String = { it.toString()}){
    
        override fun toString(): String {
            return callback(node)
        }
    }
    d
    • 2
    • 20
Powered by Linen
Title
v

Vinicius Carvalho

04/30/2020, 10:40 PM
Wrapped all TreeItems on a
NodePrinter
(I'm horrible naming things) that either use toString or a custom
(T) -> String
function. For some items I override that callback to print the version property, others that are plain string with the image I let the TreeView print them with the graphic and text
class NodePrinter<T>(val node: T, val callback: (T) -> String = { it.toString()}){

    override fun toString(): String {
        return callback(node)
    }
}
d

Dustyn

05/01/2020, 3:52 AM
I am personally not a fan of mixing a display name with the toString method. ToString shall be the representation of the object for the programmer for logging or uargh-debugging purposes. I'd prefer a "displayName" property on those objects for that matter. And happy to see you resolved your issue! Thanks for sharing your thoughts
v

Vinicius Carvalho

05/01/2020, 11:51 AM
In this case is more than just a displayName actually, I need to switch which property to display
its more a stringconverter than anything else
so depending on the TreeItem Type, I use a different function. Could use a method called displayName() for sure and again rely on old toString for simple types for simplicity
But the problem is that if I go the route without toString it won't work
because the moment I use
cellFormat {
text = nodePrinter.displayName()
}
The images will stop showing. I could not find a way (not without a lot of effort at least) to mix text and graphic depending on the item being processed
I found an answer here: https://stackoverflow.com/questions/46207822/tornadofx-treeview-cell-factory-not-being-called but seems a hell of work for such thing
Another thing I'm still struggling with JavaFX/Tornado is how to really decouple my domain objects from the view/model I'm still not clear on the whole ViewMode ItemViewModel concept from the docs.
Most my domain objects are really simple POJOs mapped as data classes from either database or REST access.
Do I map those to a ViewModel/ItemViewModel, because I would really like to avoid having SimpleStringProperties on my domain objects, and having to create another object to have them and the view model, now I have 3 types to represent a domain entity 😞
d

Dustyn

05/02/2020, 4:02 AM
Depends what you want and how much abstraction you need. You know "Clean architecture" from Uncle Bob? You could have at GUI level your gui models whilst in the core your real domain objects are sitting and from layer to layer you can use a transformater .. there is a nice book about this topic "Getting your hands dirty with clean architecture" 🙂 <If you do not want SimpleStringProperties in your Domain i get it - which means it is important to you that your Domain is decoupled from the specific GUI framework you are using. And that the nice part of clean design, database, gui, everything are external factors which should be easily exchangeable. In order not to get messed up during coding i think handling the layers with gradle projects is a nice approach - only the gui layer can then access javafx-properties so you can during compile time be safe .. but long topic and really depends if you think this piece of software will be there in 10 years or not.
and in the end - nothing beats simplicity .. clean architecture is quite a big chunk of work.
I mean all you'd do would be a mapping from domain to gui-domain in hope you'll need it someday when you'd change the gui framework, right?
v

Vinicius Carvalho

05/03/2020, 12:14 AM
Thanks for the input, in the end I think I may just be overthinking this. Having my view model be just a representation of domain object elsewhere is not that bad. Also made piece with those that come from a database, for now the app I'm building ship with its own H2 database, its not as I will need those objects anywhere else.
Again, thanks for all the help
Having a lot of fun learning more about javafx and tornado. I was already giving up on UI and java. I'm glad we have a lightway alternative to electron 😄 and one that does not require you to write javascript
d

Dustyn

05/03/2020, 11:10 AM
oh man yes! i personally couldnt stand javascript. Typescript okay, maybe. But UI with kotlin and tornadofx is just really nice
out of curiosity - why did you need a embedded db for your application? i had this thought as well - but for now i will go with just a normal tree datastructure .. but for now i have just one view where all data sits
v

Vinicius Carvalho

05/03/2020, 4:03 PM
There's no real reason besides the fact that I'm way more familiar with SQL. I may need to do some more complex queries. H2 is a phenomenal DB, performance is amazing for a single client. I prefer it to sqlite to be honest. One problem I'm having is that if my app crashes (happens quite often in development) my db can get locked, as the file lock is not released, this is a bit of pain.
Another thing I like about H2, because its just SQL I'm using flyway for db migration for example, so on start I create all tables and insert base entities. In a real app, when a new version gets released I can count on flyway to perform table schema updates, find deltas and such. neat feature
View count: 1