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

    Sergio Casero

    11/22/2018, 4:53 PM
    Hello guys, I'm getting an error when I try to execute the app. I have two modules, one for network, and one for views, the behaviour is the follow: 1. If I use `application`plugin, everything works fine 2. If I use
    TornadoFX App
    run configurations, I get ->
    Caused by: java.lang.NoClassDefFoundError: com/sergiocasero/network/ApiService
    3. If I use FxLauncer -> Same than 2
    e
    c
    n
    • 4
    • 35
  • e

    edvin

    11/22/2018, 6:10 PM
    @gtnarg I've committed something that might solve the onEdit issue. Let me know 🙂
    g
    • 2
    • 2
  • r

    Ruckus

    11/23/2018, 7:01 PM
    @carldea https://stackoverflow.com/a/42544032
    👍 1
    c
    • 2
    • 1
  • r

    Ruckus

    11/23/2018, 7:02 PM
    Is that what you're looking for?
    c
    • 2
    • 2
  • c

    carldea

    11/23/2018, 7:56 PM
    I usually go to get custom fonts from Google https://fonts.google.com/
    r
    • 2
    • 1
  • a

    amanda.hinchman-dominguez

    11/24/2018, 5:33 PM
    np!
    s
    • 2
    • 3
  • d

    dr.fornax

    11/24/2018, 6:11 PM
    Hi all, you have not seen me for a while but after a long time I’m back, I’m still in hospital but try to start with tornadofx again
    c
    g
    • 3
    • 2
  • d

    dr.fornax

    11/24/2018, 6:14 PM
    I would like to start with a question, say we have 2 scrollable views side by side and I would like to sync the scrollbar, so when I scroll one view, the other one beside the view shall be scrolled to the same position. How would I realize this?
    g
    • 2
    • 3
  • e

    edvin

    11/25/2018, 10:50 AM
    g
    c
    • 3
    • 3
  • e

    edvin

    11/25/2018, 10:52 AM
    @carldea Nice! In your stylesheet you have declared pixel values like this:
    strokeWidth = Dimension(2.0, Dimension.LinearUnits.px)
    . We have extension functions for those, so you should just write
    strokeWidth = 2.px
    c
    • 2
    • 1
  • r

    Ruckus

    11/25/2018, 8:08 PM
    @carldea Also in the CSS, where you use
    property = multi(value)
    You can just use
    property += value
    👍 2
    c
    • 2
    • 1
  • r

    Ruckus

    11/26/2018, 3:41 AM
    Off topic: Here's one of the new decorations for this year
    👍 2
    n
    • 2
    • 1
  • t

    thomasnield

    11/26/2018, 4:36 PM
    Just noticed something very problematic. It seems the JavaFX
    ComboBox
    does not like null values at all. Try selecting
    null
    in the dropdown and it will throw an error.
    c
    c
    • 3
    • 5
  • t

    thomasnield

    11/26/2018, 5:03 PM
    But I'll see if this is resolved in the OpenJFX possibly.
    a
    • 2
    • 2
  • t

    thomasnield

    11/26/2018, 5:06 PM
    @carlw sigh alright, although that can be Kotlin's job with the null-type system.
    c
    • 2
    • 6
  • e

    edvin

    11/26/2018, 5:42 PM
    A funny curiousity - adding
    null
    as an item is totally valid for
    choicebox
    🙂
    a
    • 2
    • 1
  • s

    Shan

    11/26/2018, 8:59 PM
    Hello all. Back to working on my project after a break and have been thinking about TornadoFX's type safe css. Coming from a web dev background, I've always done my CSS in this way:
    menu, menuButton, otherThing { some styles }
    where I would apply a specific set of styles to multiple css classes just by adding them to the list before the style declaration. As far as I can tell, the only way to achieve something like this in Kotlin would be to make a function that would loop through every css element argument and apply the styles to each one. Is there a reason TornadoFX's type safe css doesn't allow this sort of functionality (Kotlin coding conventions I would assume, but maybe there is a different reason? For safety, or something), or are there plans to add something like this in the future? I would be interested in hearing any sort of arguments against this sort of thing, as well! God knows there are thousands of code safety hazards in web development.
    a
    • 2
    • 1
  • s

    Spike Baylor

    11/27/2018, 1:17 PM
    i was trying to look that up yesterday after reading the original question. I think select() could use a nice little blurb in the documentation. the shortened s() is used in an example but doesn't have much explaining what it is or how its used.
    r
    c
    • 3
    • 9
  • s

    Shan

    11/27/2018, 7:56 PM
    Hey all! Wondering if there is an easy way to bind something with some kind of offset in place, like binding something to the stage's widthProperty but always subtracting a certain amount? Do I need to bind to a different property I make which is
    = widthProperty() - customSubtractValue)
    , or is there a way to do this without having to create a custom property (if this is even possible 😬)? This is what I'm trying to do, but obviously it will not work as I cannot subtract a
    .px
    val from an observable property.
    prefWidthProperty().bind(primaryStage.widthProperty() - sideBarWidth)
    r
    • 2
    • 2
  • s

    Spike Baylor

    11/28/2018, 4:48 PM
    not always as cleanly and nice as when making things from scratch with tornadofx, but still quite compatible and nice to work with. I'm using JFoenix's Drawer, Hamburger Button, and Switch in my TornadoFX based app.
    s
    • 2
    • 9
  • j

    jschneider

    12/03/2018, 12:57 PM
    I am setting the "alignment" to Pos.BASELINE_LEFT for the class "label-container".
    r
    g
    • 3
    • 6
  • f

    FRQDO

    12/05/2018, 5:30 AM
    Hey there! Maybe someone can help me figure this out:
    class MyApp : App(Workspace::class, Styles::class) {
        init {
            with (workspace) {
                // This does NOT remove the forwardButton
                forwardButton.removeFromParent()
                // This does
                header.items.remove(forwardButton)
                // And so does this
                header.getChildList()?.remove(forwardButton)
            }
        }
    }
    However, the implementation of
    removeFromParent()
    says
    when (this) {
            […]
            is Node -> {
                (parent?.parent as? ToolBar)?.items?.remove(this) ?: parent?.getChildList()?.remove(this)
            }
            […]
        }
    The
    forwardButton
    is a
    Node
    and is created within a
    toolbar
    builder, so its parent should be set to that toolbar. Therefore, I’m a bit confused by the
    parent?.parent
    part on the left of the Elvis operator. I then tried printing the
    forwardButton
    (which is a
    Button
    ), its parent (which is
    null
    ) and its parent’s parent (which in that case obviously doesn’t exist). So, at which point in the
    Workspace
    does the
    forwardButton
    become an orphan?
    • 1
    • 1
  • p

    pike

    12/05/2018, 6:23 AM
    https://edvin.gitbooks.io/tornadofx-guide/part2/Workspaces.html says you can remove it workspace.backButton.removeFromParent()
    f
    • 2
    • 2
  • c

    carlw

    12/05/2018, 11:34 AM
    @FRQDO try that code in an onBeforeShow() rather than an init block in the App subclass
    f
    • 2
    • 2
  • c

    carlw

    12/08/2018, 4:02 AM
    @ianbrandt you need to specify a finite cyclecount. your loop will never finish (it's indefinite)
    i
    r
    • 3
    • 2
  • b

    Boyong

    12/08/2018, 9:28 AM
    Hi all, I am having difficulties in performing validation. I will like the validation error to appear once I click on the submit button.
    f
    e
    • 3
    • 28
  • e

    edvin

    12/08/2018, 7:08 PM
    I'm writing a small .NET/WFP app today and I already miss JavaFX/TornadoFX 🙂 Do those guys still use INotifyPropertyChanged for observable properties? Reminds me of good 'ol PropertyChangeEvent.. but it's 2018, they must have some kind of observable properties you don't have to write manually, right? Confused..
    a
    • 2
    • 2
  • c

    Carlton Whitehead

    12/09/2018, 4:09 PM
    JFXtras has agenda and icalendar modules that might be a fit http://jfxtras.org/
    b
    • 2
    • 1
  • h

    hudsonb

    12/09/2018, 5:23 PM
    CalendarFX: https://github.com/dlemmermann/CalendarFX
    b
    e
    • 3
    • 5
  • r

    Roman

    12/10/2018, 5:59 AM
    is there easy way to prevent run multiple instance application? windows 10, exe created with javapackager
    c
    r
    • 3
    • 5
Powered by Linen
Title
r

Roman

12/10/2018, 5:59 AM
is there easy way to prevent run multiple instance application? windows 10, exe created with javapackager
c

Czar

12/10/2018, 6:54 AM
This question is really not relevant in this slack and channel, next time use google please. But this time here ya go 🙂 https://rosettacode.org/wiki/Determine_if_only_one_instance_is_running
By the way, examples in different languages utilize different strategies, the ones offered for Kotlin and Java are unfortunate unreliable hacks, I'd resort to lock files instead of a network port.
And this is even more foolproof, although you will need JNA: https://stackoverflow.com/questions/44744804/how-can-you-use-a-mutex-between-c-sharp-and-java-processes
r

Romanow

12/10/2018, 10:53 AM
We use jUnique for that
https://mvnrepository.com/artifact/it.sauronsoftware/junique/1.0.4
View count: 4