Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
psudo3408yIt's been a long time since I looked at doing a Java gui, but I don't remember there being a threading issue in swing.
What are you seeing and what are you expecting? -
@psudo I have a vector called bookingsvector that's has a collection of bookings objects loaded from an sqlite database.when I add a booking,thats entered into an sqlite database using a separate jframe(let's call it bookings frame )and the booking was made for today itself.i have a jlist on the main jframe that's supposed to refresh itself and have all the bookings that were schedules for today.im using threads to get into the main jframe and call the method(getBookingsforToday) and refresh the jlist
The method does actually execute and output is actually given.but the jlist itself stays the same. -
psudo3408y@zmzmuazzam98 If those threads you spawned are SwingWorkers in not sure what's wrong.
But it sounds like you might be trying to use normal threads, which break the swing concurrency model. -
May be I misunderstood, but I guess updating views from threads is a challenge in all languages. View always run in the main thread, so you can only update view from the main thread. At least that's the case for JavaScript, and android and iOS.
Related Rants
Threading in Java doesn't work properly with swing,i'm sad..hopefully it will work with Java FX
undefined
swing
javafx
java
threading