This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

updating GUI from another thread

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have one Thread that is working as a queue for another two thread which process the data. I may call them as DataLoader and DataProcessors.

DataLoader fires events how the progress is going on, or if processing is finished, cancelled, paused, etc. Say I want to disable some buttons when event is fired.

First I fired events using invokeLater() from DataLoader, I noticed that nothing happens. After this event fired (I had disable button code in JButton action for testing) I pressed the button, disablation works on second pressing time wtf... Please explain me why?

I have got it working by calling invokeLater() in GUI code (Listener) and run the buttons disablation code inside it.
 
Mikko Kohtamäki
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well this was not a thread issue (Swing issue), I posted too early. Sorry...

Issue solved, OptionPaneUI uninstalls and installs components after almost every property change. In where I wanted disable buttons.
 
reply
    Bookmark Topic Watch Topic
  • New Topic