Click here to Skip to main content
15,887,027 members
Home / Discussions / Java
   

Java

 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Richard Deeming5-Sep-23 21:23
mveRichard Deeming5-Sep-23 21:23 
GeneralRe: Getting java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullP Pin
Richard MacCutchan5-Sep-23 22:43
mveRichard MacCutchan5-Sep-23 22:43 
QuestionWhat is the difference between a static and an instance variable in Java? Pin
Ashley OP7-Aug-23 23:31
Ashley OP7-Aug-23 23:31 
AnswerRe: What is the difference between a static and an instance variable in Java? Pin
Richard MacCutchan7-Aug-23 23:33
mveRichard MacCutchan7-Aug-23 23:33 
QuestionJavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 6:37
JohnCodding21-Jul-23 6:37 
AnswerRe: JavaFX multithreading operation changing GUI elements Pin
JudyL_MD21-Jul-23 9:01
JudyL_MD21-Jul-23 9:01 
GeneralRe: JavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 9:44
JohnCodding21-Jul-23 9:44 
GeneralRe: JavaFX multithreading operation changing GUI elements Pin
JudyL_MD21-Jul-23 10:46
JudyL_MD21-Jul-23 10:46 
And that is exactly what my code does. It creates the thread worker from the UI thread and starts it. It then exits that UI function, effectively releasing the UI thread. Meanwhile, worker is executing its Run method separately from the UI. After it finishes doing stuff, worker then creates and runs a UI thread that updates the UI. JavaFX may have a different method to call instead of runOnUiThread, but the logic is the same. JavaFX has to have an equivalent.

Don't be confused by the code appearing to all be in the initial UI function. Each of those Run methods is a chunk of code that executes in a separate and distinct thread.

One caveat -- when running on Android, I have found that this doesn't always work to release the UI when it is done from within view creation / fragment startup. I don't know if JavaFX has the same issue. What I've shown works when launched from the UI once the screen is up and established; for example, from a menu item click handler.
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein

AnswerRe: JavaFX multithreading operation changing GUI elements Pin
JohnCodding21-Jul-23 9:49
JohnCodding21-Jul-23 9:49 
QuestionOperator precedence Pin
darek2902198812-Jul-23 5:41
darek2902198812-Jul-23 5:41 
AnswerRe: Operator precedence Pin
Dave Kreskowiak12-Jul-23 6:11
mveDave Kreskowiak12-Jul-23 6:11 
QuestionOperator precedence Pin
darek2902198811-Jul-23 3:06
darek2902198811-Jul-23 3:06 
AnswerRe: Operator precedence Pin
Richard Deeming11-Jul-23 3:30
mveRichard Deeming11-Jul-23 3:30 
GeneralRe: Operator precedence Pin
darek2902198812-Jul-23 5:44
darek2902198812-Jul-23 5:44 
GeneralRe: Operator precedence Pin
jeron112-Jul-23 6:15
jeron112-Jul-23 6:15 
AnswerRe: Operator precedence Pin
Richard MacCutchan11-Jul-23 5:24
mveRichard MacCutchan11-Jul-23 5:24 
GeneralRe: Operator precedence Pin
darek2902198812-Jul-23 5:46
darek2902198812-Jul-23 5:46 
QuestionRe: Operator precedence Pin
Richard MacCutchan12-Jul-23 6:15
mveRichard MacCutchan12-Jul-23 6:15 
AnswerRe: Operator precedence Pin
Andre Oosthuizen14-Jul-23 1:36
mveAndre Oosthuizen14-Jul-23 1:36 
GeneralRe: Operator precedence Pin
Richard MacCutchan14-Jul-23 1:52
mveRichard MacCutchan14-Jul-23 1:52 
QuestionSign a PDF document in PAdeS format using a CNS (National Services Card) or a SmartCard. Pin
Antonio20238-Jul-23 19:45
Antonio20238-Jul-23 19:45 
QuestionRelative Sorting Pin
Harriet Muduwa26-Jun-23 6:42
Harriet Muduwa26-Jun-23 6:42 
AnswerRe: Relative Sorting Pin
Pete O'Hanlon26-Jun-23 7:12
mvePete O'Hanlon26-Jun-23 7:12 
AnswerRe: Relative Sorting Pin
Victor Nijegorodov26-Jun-23 7:13
Victor Nijegorodov26-Jun-23 7:13 
AnswerRe: Relative Sorting Pin
jimakoskx28-Jun-23 23:34
jimakoskx28-Jun-23 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.