I have a class which creates the ui.
it also creates a thread.
When the user presses a button I want to change a boolean from the other thread, how do I do that?
Printable View
I have a class which creates the ui.
it also creates a thread.
When the user presses a button I want to change a boolean from the other thread, how do I do that?
I'm confused as a boolean doesn't really exist within a thread though can be changed from one thread or another. Is the boolean volatile? Perhaps you would be best served to create a small compilable example of your problem, an SSCCE.
I know practicly nothing of threading but I got a class which extends runnable
that class has a boolean
I create a thread of that class but when I press a button I want a boolean in That class set to false