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

    bjonnh

    01/02/2019, 10:37 PM
    that may be due to the fact that I use a tiling WM…
    a
    • 2
    • 3
  • s

    Sergio Casero

    01/03/2019, 7:33 PM
    Hi all, is this the best approach to "center crop" an image into imageView??
    imageview(productViewModel.image) {
                        imageProperty().addListener { _, _, image ->
                            val newMeasure = image.width
                            val x = (image.width - newMeasure) / 2
                            val y = (image.height - newMeasure) / 2
    
                            val croppedPortion = Rectangle2D(x, y, newMeasure, newMeasure)
                            viewport = croppedPortion
                            fitWidth = 300.0
                            fitHeight = 300.0
                            isSmooth = true
                        }
                    }
    r
    • 2
    • 2
  • c

    carlw

    01/03/2019, 9:53 PM
    @Ruckus in the other kotlin groups, have you seen anyone using Optional to provide an object shell around an empty values?
    r
    • 2
    • 1
  • b

    bjonnh

    01/04/2019, 3:59 AM
    How could I get a converter for the selectionModelProperty() of a combobox? the same way textfield does it?
    • 1
    • 3
  • h

    hudsonb

    01/04/2019, 4:03 AM
    Yay, making some progress on porting my collection of kubed demos over to a TornadoFX-based "showcase" application rather than a bunch of standalone apps!
    🎉 3
    t
    • 2
    • 1
  • b

    bjonnh

    01/04/2019, 2:33 PM
    @Carlton Whitehead so controlsfx adds autocompletion to textentries too?
    c
    • 2
    • 1
  • c

    carlw

    01/04/2019, 3:19 PM
    i'll look at ktor when i write a tornadoFX client for the above post
    h
    • 2
    • 1
  • b

    bjonnh

    01/07/2019, 5:17 PM
    I have an issue with a ViewModel. I have this in it:
    var journal = bind(forceObjectProperty = true) { citation?.observable(Citation::journal_id) as Property<Int>? }
        var journalEntry = bind {
                legacyController.journalList?.getElement(journal.value).toProperty()
        }
    It is used to feed a combobox, but the problem is even before that I can see it when I do:
    model.journalEntry.onChange { println("Changed the journal to $it") }
    The model is defined as a
    class CitationModel(var citation: Citation?) : ViewModel() { … }
    The model is by default a
    val model = CitationModel(null)
    Once the user loads something, I do a
    citationView.model.rebind {
                                    citation = newCitation
                                }
    where newCitation is coming from some database query. I get the right call to rebind, and the object bound is the good one.
    • 1
    • 2
  • h

    hudsonb

    01/07/2019, 6:09 PM
    Anyone know of a
    Parent
    impl that will scale it's content to fit?
    r
    c
    • 3
    • 10
  • s

    Shan

    01/10/2019, 12:41 AM
    I tried to consolidate my classes into an example to post here. Could anyone explain to me how to use a ViewModel & bindings to update the value of
    changeableName
    in this example when I hit the "save" button in
    RenameFragmentTest
    ? I must learn!
    -.txt
    a
    • 2
    • 6
  • s

    sbyrne

    01/10/2019, 12:53 AM
    I think "A Master/Detail example" in the "Scopes" section of the Guide shows you how to do this.
    s
    e
    • 3
    • 3
  • j

    jchildress

    01/10/2019, 2:31 AM

    https://www.youtube.com/watch?v=OuF2BMnCjt4&amp;t=862s▾

    👍 4
    a
    • 2
    • 1
  • e

    edvin

    01/10/2019, 12:10 PM
    If the view is blank, try downloading it
    s
    • 2
    • 2
  • h

    hudsonb

    01/11/2019, 2:09 PM
    It'd be a neat feature to allow other it to point at other people's accounts and pull in their gists too but then for sure I'd have to start dealing with SecurityManager and all that, bleh
    g
    • 2
    • 1
  • c

    carlw

    01/11/2019, 4:08 PM
    Since your audience is developers, you can ask them to run $ javaws http://www.example.com/mydemo.jnlp
    h
    • 2
    • 1
  • c

    carlw

    01/11/2019, 4:27 PM
    @Shan this will refresh every time the window is shown including the first time
    Refreshing_a_View_at_Start_and_When_Shown.java
    🙂 1
    👍 1
    s
    • 2
    • 2
  • e

    elifarley

    01/11/2019, 4:29 PM
    Hi everyone, I'm unable to fix a compilation problem on the TableSelectView article (https://edvin.town/leveraging-tornadofx-to-the-fullest/) All calls to
    column(...)
    below cause this error:
    None of the following functions can be called with the arguments supplied.
    override val root = vbox(10.0) {
            tableview(items) {
                column("SKU", Item::sku) 
                column("Item", Item::descr)
                column("Price", Item::price)
                column("Taxable", Item::taxable)
                bindSelected(mySelectedItem)
                setPrefSize(667.0, 376.0)
                columnResizePolicy = CONSTRAINED_RESIZE_POLICY
                vgrow = Priority.ALWAYS
            }
    h
    • 2
    • 4
  • c

    carlw

    01/12/2019, 12:53 PM
    @hudsonb you're right. the wrap() isn't needed. I updated my gist accordingly (and pulled it out of the client's code too)
    a
    h
    • 3
    • 3
  • n

    Nikky

    01/13/2019, 5:20 AM
    if its a single file.. with multiples you may have to include multiples.. which is currently only possible using kotlin-dev
    h
    • 2
    • 3
  • j

    jchildress

    01/14/2019, 1:13 PM
    http://www.jfoenix.com/
    g
    • 2
    • 1
  • s

    sbyrne

    01/14/2019, 5:43 PM
    How do I get the application name in the MacOS menu bar to be something other than "java"?
    h
    c
    • 3
    • 4
  • n

    nate

    01/15/2019, 8:49 PM
    hey guys, quick question! so i'm creating a card that looks like the image attached. I'm having problems trying to add the white blur/background effect that the text
    chapter 01
    sits on top of. i've tried using box-shadow's and blooms but not to the desired result yet. any idea how I would be able to achieve this? I'd appreciate a nudge in the right direction. thanks
    h
    r
    • 3
    • 5
  • e

    elifarley

    01/17/2019, 5:08 PM
    Hi, how can a view access command-line arguments? I know the application can via
    parameters.unnamed.firstOrNull()
    for instance, but how can a view access its enclosing Application ?
    h
    • 2
    • 2
  • c

    carlw

    01/17/2019, 5:18 PM
    @elifarley take a look at the end of this article https://courses.bekwam.net/public_tutorials/bkcourse_tornadofx_mdi.html
    e
    • 2
    • 1
  • e

    elifarley

    01/17/2019, 11:33 PM
    I'm using https://github.com/beryx-gist/badass-jlink-example-kotlin-tornadofx to create a TornadoFX app with an embedded JVM so that users don't have to have one installed on their systems. My app needs a web view, and even though the example project compiles fine as is, once I add the
    javafx.web
    module to
    module-info.java
    , I get an error:
    gradle jlinkZip
    
    > Task :discoverMainScriptsExtensions
    e: Module javafx.web cannot be found in the module graph
    > Task :compileKotlin FAILED
    c
    • 2
    • 3
  • a

    amiracam

    01/18/2019, 7:46 PM
    hi newbie here, this most simplest of code snippets doesn’t work:
    import tornadofx.View
    import tornadofx.button
    import tornadofx.label
    
    /**
     * Created by charles  on 2019-01-18.
     */
    class MyView: View() {
    
        override val root: vbox {
            button("Press me")
            label("Waiting")
        }
    
    }
    IDEA claims it can’t find vbox I’m on jdk1.8.0_131 here’s my gradle build
    plugins {
        id "org.jetbrains.kotlin.jvm" version "1.3.11"
    }
    
    group 'polyglotric'
    version '1.0-SNAPSHOT'
    
    apply plugin: 'kotlin'
    apply plugin: 'application'
    
    mainClassName = 'com.polyglotric.MyApp'
    
    dependencies {
        compile 'org.jetbrains.kotlin:kotlin-stdlib'
        compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
        compile group: 'no.tornado', name: 'tornadofx', version: '1.7.18'
    }
    repositories {
        mavenCentral()
    }
    
    task wrapper(type: Wrapper) {
        gradleVersion = '4.2.1'
    }
    
    compileKotlin {
        kotlinOptions {
            jvmTarget = '1.8'
        }
    }
    thanks for the help
    r
    n
    • 3
    • 2
  • c

    carlw

    01/18/2019, 8:05 PM
    try compile "no.tornado:tornadofx:1.7.18"
    c
    • 2
    • 2
  • a

    amiracam

    01/18/2019, 8:21 PM
    I also just upgraded to the latest version of IDEA , just in case that was of any impact , still same issues
    c
    s
    • 3
    • 5
  • n

    Nico Smeenk

    01/19/2019, 11:29 PM
    Hey guys, I am struggling with some Problems with css in FX. I use the rowExtender on a table view and give it a whitish background. When selecting the entry in the table and opening the expander I did not find a way to change the text color of the label (see following GIF). Any Idea? Thanks!
    Problem_with_rowExpander_and_custom_background.kt
    a
    • 2
    • 6
  • a

    amanda.hinchman-dominguez

    01/20/2019, 12:06 AM
    In here, the test does not register the the stage at all. But it does look like it is necessary to have a View for a fragment to exist on. How far off am I?
    s
    • 2
    • 7
Powered by Linen
Title
a

amanda.hinchman-dominguez

01/20/2019, 12:06 AM
In here, the test does not register the the stage at all. But it does look like it is necessary to have a View for a fragment to exist on. How far off am I?
s

SackCastellon

01/20/2019, 1:28 PM
This is because this is a Test App which is intended to be run as a standard app (https://github.com/edvin/tornadofx/wiki/Application-Startup#application-startup)
💯 1
a

amanda.hinchman-dominguez

01/20/2019, 3:18 PM
This is awesome! Thank you so much! For the TestApp written though, I don't know where this is actually being used to test. Although to be honest, it doesn't seem like the search function for text in repositories are working in Github 😕
s

SackCastellon

01/20/2019, 3:37 PM
I'm not sure if I understand you correctly. When you say "where this is actually being used to test", do you mean "where is the TestApp called to test that it works"?
a

amanda.hinchman-dominguez

01/20/2019, 3:44 PM
@SackCastellon yeah!
s

SackCastellon

01/20/2019, 3:50 PM
Well, as I see them, they are just samples of how to use TornadoFX to build a specific view. In that case, how to create a
ListView
with a custom cell. So they are not used to test if things work, at least not automatically, you could run them if you wanted, but manually.
It's like https://github.com/edvin/tornadofx-samples but at a smaller scale.
View count: 1