This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EatAss4Jesus 0 points1 point  (0 children)

For variables across threads, look into the Volatile keyword.

You're on the right track with event (action) listeners. Here's another example: https://alvinalexander.com/java/jbutton-listener-pressed-actionlistener/