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
  • a

    amanda.hinchman-dominguez

    01/20/2019, 12:12 AM
    There is a a registered primary stage call here and the only component here is a form. I suppose this makes sense, but it makes me curious, does this mean that when you call
    FxToolkit.registerPrimaryStage( )
    , do we do this to basically have a listener for the existence of components on the stage? I suppose using the
    FxToolkit
    is the JavaFX way of testing - does this mean that when you initialize TornadoFX `View`/`Fragment`, it is implied that there is a stage?
    s
    • 2
    • 6
  • b

    BenjaVR

    01/20/2019, 5:36 PM
    As I am a professional .NET developer, I'm wondering if JavaFX is still actively used in the industry? It seems nice (especially TornadoFX with Kotlin), but Java in general is not my main thing
    c
    • 2
    • 3
  • a

    amanda.hinchman-dominguez

    01/21/2019, 1:58 AM
    @elifarley you can add to your table
    onUserSelect(1) { *action* }
    where the parameter is how many times a row is clicked
    e
    • 2
    • 2
  • a

    amanda.hinchman-dominguez

    01/21/2019, 3:51 AM
    class Test: ApplicationTest() {
    
        override fun start(stage: Stage?) {
            setInScope(CatScheduleModel(), CatScheduleScope())
            val sceneRoot = Editor().root
            addAllIdsToDescendents(sceneRoot)
            stage?.scene = Scene(sceneRoot, 100.0, 100.0)
            stage?.show()
        }
        .....
        @Test fun testTextfield() {
            val textfield = lookup("#beep") as TextField
            verifyThat("#beep", hasText(textfield.text))
        }
    }
    c
    • 2
    • 6
  • a

    amanda.hinchman-dominguez

    01/21/2019, 6:02 PM
    @Carlton Whitehead update: I added
    primaryStage.show()
    after adding the ids to the view!! Forgot this necessary step. I'm now getting a new error message:
    IllegalStateException: Not on FX application thread; currentThread = main
    h
    • 2
    • 3
  • a

    amanda.hinchman-dominguez

    01/22/2019, 8:49 PM
    @Czar welcome to the TornadoFX community! As a general rule I gave myself, if I think we could learn together on the channel I keep it to the main thread. I totally agree that threads and their lack of features make it hard to segment conversations on here. I'm not as familiar with
    by di()
    - can you provide an example?
    by inject
    is how we easily do dependency injection with models/views/controllers in TornadoFX
    c
    • 2
    • 1
  • a

    amanda.hinchman-dominguez

    01/22/2019, 9:27 PM
    both are for dependency injection.
    inject()
    is for singleton components (
    Models()
    ,
    Views()
    ,
    Controllers()
    ) which is TornadoFX specific. For
    di()
    , you can inject third party resources by creating an
    FX.dicontainer
    c
    e
    • 3
    • 97
  • n

    Nicklas Desens

    01/24/2019, 9:26 AM
    Hello, a question. Does anyone know a way after a button was clicked to automatically reset the view to its initial state? Thanks for answers
    s
    e
    • 3
    • 2
  • m

    mariofelesdossantosjr

    01/24/2019, 12:16 PM
    Hello, does anyone have any examples with TornadoFX, Hibernate and ViewModel?
    c
    • 2
    • 1
  • s

    sbyrne

    01/24/2019, 8:29 PM
    I add a CSS class "note" to only some Labels in a TreeTableCell. CSS
    cell { note { backgroundColor += Color.RED } }
    works as expected (only coloring those labels).
    cell { and(selected) { backgroundColor += Color.RED } }
    works as expected (coloring everything in the selected row).
    cell { and(selected) { note { backgroundColor += Color.RED } } }
    has no effect. I expected it to color only the labels with the "note" class in the selected row.
    r
    • 2
    • 1
  • e

    elifarley

    01/25/2019, 1:17 PM
    I need to open the default web browser from a context menu action, so I call
    hostServices.showDocument("<https://google.com/>")
    , but it always gives me this error:
    NullPointerException
    	at javafx.application.HostServices.showDocument(HostServices.java:127)
    	at myapps.desktop.views.myappListView$master$1$1$8$2.invoke(myappListView.kt:117)
    	at myapps.desktop.views.myappListView$master$1$1$8$2.invoke(myappListView.kt:34)
    	at tornadofx.ControlsKt$action$4.handle(Controls.kt:417)
    	at tornadofx.ControlsKt$action$4.handle(Controls.kt)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    • 1
    • 2
  • c

    carlw

    01/25/2019, 1:36 PM
    i got the NPE with 181 but not 201
    e
    • 2
    • 1
  • b

    Brian

    01/25/2019, 4:08 PM
    Has anyone used Cucumber and TestFX with their TornadoFX app? I have it working when the app is rendered on-screen during testing, but it breaks if I try to run the tests headless with Monocle.
    a
    • 2
    • 1
  • a

    amanda.hinchman-dominguez

    01/26/2019, 11:59 PM
    Untitled.kt
    b
    • 2
    • 7
  • s

    Shan

    01/27/2019, 3:02 AM
    It's having a type inference failure on the
    item
    from what I can gather from the error because menu items extend Object not Node, I believe.
    n
    • 2
    • 1
  • e

    edvin

    01/28/2019, 6:57 PM
    @bjonnh That depends if you need to manipulate different data types etc. That approach is very generic and is mainly for displaying data. If you have a set of different column layouts I still recommend hard coding them, or at least add some data to the datasets so you can configure the correct type of column/editor if needed.
    b
    • 2
    • 1
  • b

    bjonnh

    01/28/2019, 10:36 PM
    maybe elsewhere because it is not tornado related
    c
    • 2
    • 11
  • d

    Dustin Jensen

    01/29/2019, 8:07 PM
    1. Excellent 🙂 Good to know for this evening when I start working on having multiple views with switching. 2. That is ok, just thought I'd check, trying to keep the code as clean as possible as I go, so I don't have to circle back as much.
    r
    • 2
    • 1
  • c

    carlw

    01/31/2019, 3:36 PM
    @alex Most DI takes place at object instantiation time. When you instantiate an object with dependencies, those dependencies are instantiated (and so on). This is called wiring up an app in Spring and Guice parlance. This means forgoing the new operator and using the container in the entry point for your program. There's also the option of delaying the dependency injection. This can be done by interacting with the container as the program is running. You might delay injection because of performance via lazy loading. You might also do this to break cycles whereby two objects reference each other. One object can use the normal means of DI where as the other object (up to you which is which) must call though the container at a later date. As a user, this should all be taken care of behind the scenes and your program starts with each component able to execute in the proper context. For something like an EJB, this means with all the datasources and JMS queue connections to do its work. On a UI, this might mean a shared EventBus. So, besides a few annotations (-at-Inject) and a little interaction with the container (getBean(), injector.get()), you shouldn't have to do any clean up or worry about byte code generation.
    👍 1
    a
    • 2
    • 5
  • b

    bjonnh

    01/31/2019, 8:38 PM
    @edvin a resizable squeezebox would be great. How hard would that be to implement that?
    e
    • 2
    • 3
  • s

    Shan

    02/01/2019, 6:20 AM
    I need to get the width of the
    LabeledText
    inside of the TitledPane somehow
    a
    • 2
    • 1
  • s

    Shan

    02/01/2019, 6:38 AM
    I actually just came up with a solution to my issue from yesterday that wasn't suggested anywhere and works great! I made a separate
    BorderPane
    that contains a
    label
    with my TitledPane's title, and a separate
    hbox
    for the icon and the menu. I then bound its prefWidthProperty like this:
    prefWidthProperty().bind(this@apply.widthProperty().subtract(Styles.smallishPadding.value*2))
    which binds its width to the SqueezeBox's width minus the padding I have added. Then I simply set
    contentDisplay = ContentDisplay.GRAPHIC_ONLY
    within the fold. It appears to work fine, the buttons are aligned and stick to the right side as intended.
    h
    • 2
    • 5
  • a

    amanda.hinchman-dominguez

    02/01/2019, 9:53 PM
    Hehe, I have 2 - one is KotlinTown on CodeTown, which is a bit older and holds Kotlin Thursdays: https://codetown.com/group/kotlin
    👍 1
    b
    • 2
    • 4
  • s

    Shan

    02/02/2019, 5:42 AM
    Ah, yeah I was aware that you can't use transitions in JavaFX's css implementation I was just wondering more if TornadoFX had done anything for animating in a stylesheet that I missed somewhere
    r
    • 2
    • 1
  • s

    Shan

    02/02/2019, 12:14 PM
    Does anyone have any idea how to set the Stage background color of a ModalWindow to semi-transparent? I can set the opacity to .8 or so but that makes everything within the window itself transparent, not just the background. I'm opening a fragment like this:
    RenameFragment().openModal(stageStyle = StageStyle.UTILITY, escapeClosesWindow = true)
    and setting the stage options from the returned stage to:
    newStage.scene.fill = Color.TRANSPARENT
    and in my Styles.css I'm setting the vbox root of the
    RenameFragment
    style to
    backgroundColor += Color.TRANSPARENT
    and also the
    root
    class of the Fragment to transparent, but to no effect. 😞
    l
    • 2
    • 1
  • c

    carlw

    02/02/2019, 12:52 PM
    The part with "im a test fragment" should be dark gray but let most of the background come through?
    s
    • 2
    • 3
  • b

    bjonnh

    02/04/2019, 8:41 PM
    yes, but I also need to find how to make a custom sorter
    r
    h
    • 3
    • 10
  • s

    Shan

    02/05/2019, 12:16 PM
    says it has a JavaFX implementation
    h
    a
    • 3
    • 9
  • s

    sbyrne

    02/05/2019, 4:55 PM
    It that how you are trying to launch your TornadoFX component from Swing, or is this after you already have some TornadoFX components visible?
    m
    • 2
    • 2
  • s

    Shan

    02/05/2019, 5:12 PM
    Not sure I'm understanding exactly what you're trying to achieve, but the issue with the spacing is because the original theme doesn't have a borderColor set I believe. If you set a borderColor on the original theme, the squishing doesn't occur
    b
    • 2
    • 1
Powered by Linen
Title
s

Shan

02/05/2019, 5:12 PM
Not sure I'm understanding exactly what you're trying to achieve, but the issue with the spacing is because the original theme doesn't have a borderColor set I believe. If you set a borderColor on the original theme, the squishing doesn't occur
b

bjonnh

02/05/2019, 5:16 PM
I have a dark theme and the lines in the rows do not look good at all (too dark), so I wanted to make them lighter.
View count: 1