Im pretty new to programming....so I am making a music Player that needs some features I need to treat one Event at the same time in 2 classes. For example...
The Player is plaing music on its own thread, when this music is done, it fires musicFinished(MusicEvent), go to the Playlist class and asksForAnotherMusicToPlay(), then starts playing again. When musicFinished fires all this happens at the same time: -A Logger, who is listening for the event go write it to a log file. (Do I need another thread here or the event is already treated in another thread?) -The GUI displays that the music finished, updates a label and set clock to 0.(For this I would use SwingUtilities.invokeLater, right??)
So whats the best solution for this case? Making my own event? What about the threads? do I have to make then myself??I already googled for it and found out that the actionPerformed is executed in the EDT(Event Dispatching Thread) but I dont know for other events. are they all??? Thanks