tornadofx | Lightweight JavaFX Framework for Kotlin
kandi X-RAY | tornadofx Summary
kandi X-RAY | tornadofx Summary
JavaFX Framework for Kotlin. Oracle is intending to decouple JavaFX from the JDK. We will wait until the decoupled JavaFX is available and stable before upgrading TornadoFX to support it. As of now there is little value and significant effort involved in updating to JDK 9/10, while there will be an enormous value in updating to the decoupled version.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tornadofx
tornadofx Key Features
tornadofx Examples and Code Snippets
Community Discussions
Trending Discussions on tornadofx
QUESTION
I have a simple JavaFX/TornadoFX project on Windows that builds in a JAR and runs correctly from under IntelliJ IDEA and in the JRE installed on my computer. I want to make it so that this project can run on any Windows machine without JRE installed. To do this, in IntelliJ, I created an artifact "JavaFx application" and configured it as it is written in the instructions for TornadoFX.
The executable file builds successfully, but when I try to run it I get the error "No method main in class com/example/demo/app/MyApp."
I tried to add main to the project code, as it is written in the instructions for TornadoFX, but I cannot specify this method in the project settings.
Only the MyApp class can be added automatically, but of course it does not contain the main method.
What am I doing wrong and how can I make an executable file under Windows?
My code in MyApp.kt:
...ANSWER
Answered 2021-Jul-06 at 10:15Once again I carefully re-read the manual for TornadoFx and saw the important phrase: "Notice the Kt at the end.". Thus, in the project settings in the Application class field, you need to add "Kt" by hand. I did it and it worked out as I wish.
QUESTION
I'm new with Kotlin and I'm trying to make a button open Windows notepad.
I'm doing a calculator and I wanted to implement a button to open the notepad, so the user could easily take notes at the moment of using it.
I've tried to directly use Java to execute it in runtime, but I couldn't.
I'm using TornadoFX for the GUI
Also searched for a way to do it on Kotlin, but didn't found anything.
Edit: Sorry for not including any code, but I didn't remember the exact thing I tried and I hadn't my PC, here's what I've tried:
Creating a Kotlin function with Java code
fun apuntes(){ Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories"); }
Creating a Java class with the exact same code than before, declaring a variable with Kotlin
var u: Notes = notas()
fun onAction2(fn2: Notes){ u = fn }
Where Notes is a public class and notas is a function, then tried this, as it is how I'm working with the calculator buttons:
...ANSWER
Answered 2021-May-10 at 10:14This is how you open notepad with Kotlin
QUESTION
I'm trying to verify the CSS used in a Stylesheet
that utilizes custom cssproperty
s but they don't seem to be working. I can't tell if I'm writing it all correctly and I'd like to check to see what is actually being used. Is there a way to print out a Stylesheet
?
Edit: To be clear, these are TornadoFX classes, not just plain CSS. I am trying to verify type-safe CSS, not trying to print a CSS file.
...ANSWER
Answered 2021-Mar-31 at 20:33Moving my comment to an answer
To see the CSS that will be generated by a Stylesheet
, instantiate it and call the its render()
function:
QUESTION
This question is a bit simplistic, but i couldn't figure it out for myself... What I'm trying to do is using a JavaFX Timeline to update my Polyline points. What I've got until now is as follows:
...ANSWER
Answered 2021-Mar-22 at 22:30I have not worked with TornadoFX earlier, so I gave a try with the normal JavaFX. Looks like the the UI is updating when the points are updated. May be the issue is something related to your implementation with TornadoFX.
Please check below the working example.
QUESTION
We have a desktop JavaFX application (well, TornadoFX) that downloads an archive, extracts another app from it and launches this app with macOS open
command.
Simplified kotlin code looks like:
ANSWER
Answered 2021-Mar-09 at 16:20After a lot of research and debugging, what seem to have worked for us, was to force Launch Services to register the app in its database by executing command like:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /path/to/app.app
and afterwards we could launch the app.
The idea for such solution was found in this answer.
QUESTION
I am working on a simple UI using TornadoFX and FXML (without TornadoFx's DSL).
There is only one big button who call a function with a runasync
inside and it's all working.
But... How can I bind, eg, a label text to track TaskStatus(), eg, title?
MyApp.kt
...ANSWER
Answered 2021-Feb-17 at 12:24Stupid mistake...
Need this:
QUESTION
I was playing around with TornadoFX and wanted to add a horizontal line to my screen, to see how it works. I added it to my code as follows:
...ANSWER
Answered 2021-Jan-16 at 11:36Thanks to @Slaw for helping me with this. The solution was actually quite simple. In the center
part of the solution, instead of just building all the nodes there, I had to embed them within a StackPane
. This is because center
can only take a single node.
Therefore, the solution looks like this:
QUESTION
I've been trying out Tornadofx. trying to create a custom title-bar, here's the code I'm currently trying
...ANSWER
Answered 2021-Jan-07 at 00:26I think this is a general problem in JavaFX (I mean not specific with TornadoFX).
The root cause for this is because of setting the maximized property of stage to true. Not sure what JavaFX internally does, but when you open the window from task bar and if the maximized value is true, then it renders in full screen mode.
You can fix this in two ways.
Approach #1:
When the window is opened from task bar, the iconfied property will turn off, set the stage dimensions again to screen bounds if maximized is true.
QUESTION
I am currently trying to develop a little board game in Kotlin using TornadoFX, mainly for practice purposes. But I'm currently struggling with adding the pieces to the board. I have tried many different ways that seemed logical to me, but every time its ether giving me an error message or not working at all. So as I ran out of ideas or possible solutions I'm now asking for help here on stackoverflow (for the first time ever :-)).
What's the best way or the most idiomatic way of adding pieces to a checkers board from the Controller? I also should mention that I haven't really worked with JavaFX before, so I'm learning TornadoFX from the ground up.
Here is the View of my board:
...ANSWER
Answered 2020-Dec-09 at 13:36After a week of work I finally got a solution. I will post it here, in case someone needs it in the future.
I have added the following function inside the BoardView
:
QUESTION
I want to show a dialog inside my tornadofx application, but I don't want to create the dialog in the view. I've tried to create a dialog at the controller, but this doesn't seem to work.
This is an working example on how I can create a dialog inside my View
...ANSWER
Answered 2020-Oct-14 at 21:16SOLVED: My mistake was, that I thought 'dialog' belonged to the UI Element vbox, but dialog is related to the View. Changing the variable inside the controller to View instead of an UI Element made it possible to create a dialog for this View.
This is the new Controller
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tornadofx
Guide We are gradually migrating all information from the Wiki into the Guide
KDocs
Wiki
Slack
Stack Overflow
Documentation
IntelliJ IDEA Plugin
Example Application
Maven QuickStart Archetype
Changelog
Configure your build environment to use snapshots if you want to try out the latest features:. Snapshots are published every day at GMT 16:00 if there has been any changes.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page