https://kotlinlang.org logo
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
  • g

    groostav

    10/07/2019, 3:42 AM
    does tornado fx have builders to convert `Property<T>`'s into `Flow<T>`s?
    r
    a
    • 3
    • 3
  • p

    Pawnee

    10/08/2019, 1:01 PM
    Hi, I am trying to create a UI with TornadoFX but got some trouble in using embedded views with hbox. Maybe I am missing something? Because shows up:
    class MasterView : View() {
        override val root = hbox {
            RouteView()
        }
    }
    
    class RouteView : View() {
        override val root = vbox {
            label("Routes Folder")
            combobox<String> {
    
            }
            listview<String> {
            }
            button {
                text = "Check Route"
            }
        }
    }
    However, if I put the RouteView code directly inside the MasterView hbox it works without problem - or if I use another layout like borderpane/vbox. Does hbox require something special?
    b
    r
    • 3
    • 6
  • c

    carlw

    10/12/2019, 4:09 PM
    I've had many problems with WebView through the years. So much so that I use the commercial JxBrowser instead This problem with Amazon's Java 8 distro is the latest for me https://github.com/corretto/corretto-8/issues/26
    a
    • 2
    • 1
  • s

    Spike Baylor

    10/12/2019, 4:27 PM
    Is there any way to show just the calendar that is psrt of datepicker instead of it being a popup of the text component?
    a
    r
    r
    • 4
    • 10
  • t

    tieskedh

    10/17/2019, 10:32 AM
    Hi everyone, I have an ObservableList with items. I created a CheckBox for each item in the list using Fragment and the ListView. (basically the MVC-tutorial but simplified:

    https://www.youtube.com/watch?v=DP863ceFT08▾

    ) The functionality works but I don't want to have a list but just a regular vbox. Is it possible to change the ListView to the VBox? What I basically need is a VBox with checkboxes with label based on a MutableList (names don't change) where I can get a list of checked items and a list with unchecked items in a idiomatic way (It's for my thesis...) I know VBox Has a bindChildren, but I don't know at this moment how to use that with the ListCellFragment. or if there is a similar Fragment that has startEdit and commitEdit
    r
    • 2
    • 2
  • r

    ron

    10/19/2019, 7:39 PM
    @edvin @Ruckus I just created a very very small PR but I see that the build fails on travis while it works on my system
    c
    • 2
    • 11
  • r

    ron

    10/22/2019, 8:19 PM
    interesting that you are getting that exception, I get the following
    j
    • 2
    • 1
  • a

    abhinay

    10/23/2019, 11:14 AM
    Hi @Joe S! You need the VM argument because
    DataGrid
    depends on an internal API. This will be fixed with JFX 13 as these internal APIs have been made public.
    j
    • 2
    • 3
  • r

    ron

    10/23/2019, 4:48 PM
    which vm argument
    a
    • 2
    • 1
  • a

    Ayoub Bouhtouch

    10/23/2019, 5:38 PM
    Hi, I'm new to JavaFX and TornadoFX (which I'm trying to use for a small desktop app) so I'm probably missing some basic concept, but I've been looking around for a couple days now and nothing I've tried so far works. Whenever I try running the app it fails with error
    Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
    From what I understand that seems to be linked to JavaFX missing, but I'm using JDK8 with TornadoFX 1.7.19 I've also tried running a View on its own and it fails with error
    Caused by: java.lang.NoSuchMethodError: javafx.stage.Window.getProperties()Ljavafx/collections/ObservableMap;
    which looks to me like the same error except more verbose. I am using the Oracle JDK and haven't tried OpenJDK yet.
    b
    • 2
    • 31
  • s

    snowe

    10/25/2019, 3:51 AM
    man, I'm having a ton of trouble with updating a text field. I'm just trying to use tornado for a simple visual part of my app (feeding images to opencv and then showing a histogram along with some text. I just want to continually update that text, I don't care if it's in a viewbox or whatever. Current code is extremely messy, but I really don't care. I do care if I'm following best practices (I tried using Property Bindings, but was unable to get that to work either), but really I just want to get a small dumb app working. https://github.com/snowe2010/opencvtest/blob/master/src/main/kotlin/com/tylerthrailkill/testing/main.kt I've tried following the tornadofx-guide repo, but it's quite confusing, especially for someone that isn't sure what they're actually looking for.
    s
    a
    • 3
    • 13
  • i

    iari

    10/27/2019, 7:42 AM
    i can't seem to get a DataGrid updated, when the maxCellsInRowProperty changes. it seems I should be able to call private fun updateItems() on DataGrid ...
    b
    • 2
    • 39
  • i

    iari

    10/27/2019, 10:03 AM
    what is the best ui control to change a SimpleDoubleProberty? (i cannot get a spinner to work without custom code)
    r
    • 2
    • 1
  • v

    voldyman

    10/27/2019, 5:04 PM
    what do folks use to deploy/bundle/distribute tornadofx applications? I wanted to distribute a binary for the three major platforms without the users needing to install jre before
    b
    p
    +2
    • 5
    • 13
  • c

    claudiug

    10/30/2019, 2:43 PM
    we are planning to do a windows app in dec. We thinking to use, tornadofx, javafx, wpf or qt
    d
    • 2
    • 2
  • c

    claudiug

    10/30/2019, 2:44 PM
    there is anywhere some documentation where I could see the adv over those tech?
    a
    • 2
    • 1
  • c

    claudiug

    10/30/2019, 2:44 PM
    also, is tonadofx working with the java13?
    a
    a
    • 3
    • 2
  • b

    Bogdan

    10/30/2019, 7:24 PM
    @edvin what other things need to be completed in jdk 10 branch ?
    a
    c
    a
    • 4
    • 19
  • i

    iari

    11/03/2019, 9:33 AM
    I need to convert some properties that hold poin-values to millimeters/inches or other units, and and allow the user to edit these. Is there by chance any sort of bi-directional binding with a converter in tornadoFX? https://stackoverflow.com/questions/57216415/javafx-bind-number-bidirectional-with-add-multiply (- otherwise i'd just implement this myself)
    b
    • 2
    • 3
  • v

    vmerk

    11/03/2019, 1:31 PM
    Hi, I'm trying to find the best way of creating a nullable property in an
    ItemViewModel
    of a "Java-primitive" type. The only way I figured out how to do this is to wrap it in a
    ObjectProperty
    , but the
    bind {}
    function seems to wrap the value in another property:
    Property<ObjectProperty<Boolean?>>
    The values on the labels are:
    nullableStringProperty1 = null
    nullableStringProperty2 = null
    nullableBooleanProperty1 = null
    nullableBooleanProperty2 = false
    Is there a cleaner way of dealing with nullable primitive types than
    Property<ObjectProperty<Boolean?>>
    ? Thanks.
    Untitled
    b
    i
    • 3
    • 57
  • i

    iari

    11/03/2019, 5:10 PM
    Hey everyone 🙂 I made a little TFX application 🌪️! I love having things neat and tidy, so I love having labels everywhere on my stuff: • Around my Desk: • On folders (trying to get rid of these, but) • On my drawes with my Computergear, Cables, Soldering stuff, 3d Printing stuff etc... • In the Kitchen • labels inside my freezer where i have different herbs and some veggies • labels on Tea • labels on Spices I had used inkscape for that task before - but there were several inconveniences that made me not like the workflow anymore: • Slow program start • simply too many features for my simple use case • I used Groups with cloned label-content (there will be labels that i need printed multiple times) - that was a bit cumbersome So I wrote a simple application with the sole purpose to create labels, output a pdf-document that can be printed. It's still very basic, but if any wants to check it out, let me know 😉
    👍 3
    j
    k
    b
    • 4
    • 8
  • t

    Tobias

    11/06/2019, 4:41 AM
    Hey all, just getting started with TornadoFX and I found the documentation a little sparse on how to use an
    ObservableMap
    to populate a
    TreeView
    and dynamically re-render when the underlying data changes. Any advice?
    👍 1
    c
    b
    • 3
    • 35
  • a

    albrechtroehm

    11/07/2019, 4:03 PM
    Hello everyone, I have a controller which stores the data of some workers types. At some point i need this controller to calculate the hourlyRate and I would like to inject this controller. This seems not to be possible because my class is not a tfx component so i used
    val workers = find(WorkerDatabase::class)
    which works fine if i use it in a function, but not if i declare it as a field in the class (Getting NPE if i use
    workers
    ). Maybe somebody could tell me whether i'm doing something wrong ...
    b
    • 2
    • 2
  • t

    Tobias

    11/11/2019, 12:10 AM
    Hey guys, quick layout question -- I have a
    TableView
    inside an
    HBox
    with some siblings, inside a
    VBox
    with some siblings. Can I get the table to both
    vgrow
    and
    hgrow
    to fill all available space when the window is resized?
    r
    • 2
    • 4
  • m

    Mark Fisher

    11/18/2019, 3:41 PM
    Hi all, I have a simple application that is for walking down a list of Cards. Each card has an image, and I use the "n" shortcut to move to the next card in the view by invoking a method on the controller. The main view only shows the card's main graphic, there's no lists, or other components. I have a controller loading all the cards, and holding a model for the card. When I initialise the controller, i set the model to the first card in the list, and the view is bound to the model. This all works, and I see the image for the first card when it loads. When I press "n" I can see the logging for the controller's function invocation, and it updating the model as follows:
    class CardAlignController : Controller() {
        val cards = FXCollections.observableArrayList<CardData>()
        val model = CardDataModel()
        var currentIndex = 0
    
        init {
            cards.addAll(...) // some loader code here
            model.item = cards[0]
        }
    
        fun nextCard() {
            model.item = cards[++currentIndex]
            println("Next invoked, index: $currentIndex, currentCard: ${model.card.value.name}")
        }
    but the main view doesn't update. How can I tie moving through the list to the main view? I don't have anything to do a bindSelected() on, so I'm not sure how to proceed. Thanks!
    c
    b
    • 3
    • 34
  • m

    Mark Fisher

    11/18/2019, 5:35 PM
    Another question on my card rendering application. I have the image updating as per previous thread, but I'm now looking how to scale an imageview based on an observable value. I currently have:
    imageview(model.cardUrl) {
                            x = 0.0
                            y = 0.0
                        }.also {
                            // ensure we scale from 0,0
                            val scaleBy = model.scale.value
                            val scale = Scale(scaleBy, scaleBy, 0.0, 0.0)
                            it.transforms.setAll(scale)
                        }
    but this is only changing on
    model.cardUrl
    , and doesn't update when I change the scale value. How can I use the model's scale value so it affects the scale of the drawn image? When I update it, the image doesn't change size. Note: I found I had to use an
    also
    to scale, as the
    scaleX/Y
    values in the imageview closure scale from the middle of the image and I couldn't work out how to do it from 0,0
    b
    • 2
    • 26
  • n

    nbhanji

    11/23/2019, 2:31 PM
    I have a project in mind, and I started using tornadofx - because of kotlin. I have 2 issues. 1. for my App, (stage view or main window) - I am using Borderpane. Initially, it has menubar and logo at the center view. so when I select menu item login/connect, I would like to be able to open a fragment in the center of the border pane and it to be centered. I am not sure how to do that, because when I assign the find(AppView::class).root.center = (fragment::class).root, fragment occupies the whole screen. The plan is that after login, I would fill the left side with table view - data retrieved from DB/Rest 2. Second issue has to do with form button is not leaving space between itself and last textfield in the form. I am attaching images for help. Thank you in advance.
    r
    • 2
    • 3
  • d

    Douglas KN

    11/29/2019, 3:13 AM
    When I run this minimized example code and click the button I get
    java.lang.RuntimeException: A bound value cannot be set.
    because
    x2p
    in ThingModel is two-way bound. Is there any way to change the
    val x2p = bind(Thing::x2Property)
    call to be just a one-way binding? I'm only using it for display purposes -- there's nothing that needs to be written back.
    Untitled
    a
    • 2
    • 4
  • c

    carlw

    11/29/2019, 2:51 PM
    @Douglas KN Have you seen this link? Look for "readonly = true". Unlike in plain JavaFX, bind() is a bi-directional bind by default. (In plain JavaFX you use an explicit bindBidirectionl() for two-way binding) https://github.com/edvin/tornadofx/wiki/Binding
    d
    • 2
    • 2
  • a

    amanda.hinchman-dominguez

    12/06/2019, 4:45 PM
    Shelby Cohen gave a shout-out to the TFX community at the KotlinConf closing panel! ❤️
    🎉 4
    n
    • 2
    • 3
Powered by Linen
Title
a

amanda.hinchman-dominguez

12/06/2019, 4:45 PM
Shelby Cohen gave a shout-out to the TFX community at the KotlinConf closing panel! ❤️
🎉 4
n

nimakro

12/06/2019, 6:39 PM
Nice to bad I couldn't make it this year ..I hope you hand fun @amanda.hinchman-dominguez
a

amanda.hinchman-dominguez

12/06/2019, 6:47 PM
Where are you in Germany again?
n

nimakro

12/06/2019, 7:06 PM
Karlsruhe
View count: 3