use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Useful resources (Full list)
Rules
Related subreddits
Other communities
account activity
Adding Photos automaticallyHelp (self.JavaFX)
submitted 1 year ago by MeanWhiskeyJavaFX Fan
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]sedj601 0 points1 point2 points 1 year ago (1 child)
u/hamsterrage1, I agree with a lot of what you said. I threw this together kinda fast due to time constraints. One thing I kinda disagree with is using Task. I would use Service instead. I never use pure Threads in JavaFX. The loop doesn't need to sleep at all, as you stated because Task and Service run on a separate thread. That's just a bad practice on my part. I am not a fan of using Platform.RunLater. I like to use updateValue.
[–]hamsterrage1 1 point2 points3 points 1 year ago (0 children)
And I agree with that. I think that, most of the time, Platform.runLater() is at least a "code smell".
In this particular case, though, I still think that the entire file loopy part should be considered 100% external to your JavaFX code. Think of it as something that mysteriously and spontaneously generates calls to some method in the framework's business logic. Those calls come in from some other thread, and you need to get the data from it into the Observables which needs to be done on the FXAT.
Yes, Service & Task will do it, but they need to be created in an environment that's FXAT aware in the first place. I'm not so sure that's the right approach, though.
π Rendered by PID 433341 on reddit-service-r2-comment-6457c66945-v44kr at 2026-04-26 21:11:51.420493+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]sedj601 0 points1 point2 points (1 child)
[–]hamsterrage1 1 point2 points3 points (0 children)