|
SperginMcBadposter posted:It still works, but something about it being threaded now is making that java.util code poo poo out that exception whenever the stream doesn't have anything to be read. Did you change the socket to non-blocking at some point while troubleshooting? If so put it back to blocking mode. Like Janitor Prime said you also need to update the GUI from the event dispatch thread. So in your ReadThreaded class instead of calling displayString() directly you'd call SwingUtilities.invokeLater() with a different Runnable object that calls displayString(). It might seem like overkill, and the program may even seem to work without that but at some point you will see weird behavior like parts of the GUI not updating, or text being cut off or something like that.
|
# ¿ Apr 16, 2015 16:52 |
|
|
# ¿ May 9, 2024 13:09 |
|
samcarsten posted:I'm not sure what the difference between the two is, though. Might help if you read the description of those methods on the Collection interface you’re implementing for this assignment. It explains how they should work. https://docs.oracle.com/javase/8/docs/api Choose Collection from the list on the left to see the info for that interface and you’ll see those same toArray methods. You can literally use “T” as a type in the second one if you weren’t aware.
|
# ¿ Nov 3, 2022 15:09 |
|
Tesseraction posted:On my phone but from a glance it looks like here Yeah probably just needs to move the elementStats = new… inside the records loop so each team has its own elementStats.
|
# ¿ Sep 13, 2023 14:52 |