Changing gui by pressing a button
My problem is: I have a panel with pictures in it and a progress bar, everything as an object with methods to set the pictures and to clear them all.
If I create the Object and set the pictures later in the code, everything works well. I can see the pictures appear and the progress bar is changing (I am calling updateUI() after each picture is loaded).
If I want to refresh everything by pressing on a button, it sets the pictures, but nothing is updating (also the progress bar is not changing) until everything is finished.
Can anyone tell me why this happens?
Is there a problem that the method to reset the pictures is called inside an ActionListener class, and therefore it is not possible to call updateUI()?
thanks for your help...
could you post your code so can we identify what's not going on..
Hmm the code is pretty big....
I solved the problem by using a Thread. To update the pictures in the panel, I am starting a new Thread which sets the pictures and updates the progress bar.
I am not so sure why I need that. I just read in tutorials for the progress bar that it is not possible to, for example, do a calculation and update the progress bar within one thread. Does anyone has a good explanation for this? Is it because the Thread is busy with calculating, the UI doesnt gets updatet?
Every thread has a different memory in stack.
It is because you have no way of determining where in the calculation process the code is at any given moment.
Originally Posted by mabuhay
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
By zobi316 in forum VB Classic
Last Post: 03-10-2008, 08:05 AM
By Rnatarajan1 in forum ASP.NET
Last Post: 05-23-2007, 01:31 PM
Last Post: 04-14-2006, 10:09 AM
By 2eXtreme in forum Java
Last Post: 04-05-2006, 08:38 AM
Last Post: 11-27-2001, 07:53 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center