I have a problem with the GUI that I would like to understand, but I'm confused about what is happening and I hope that one of you can explain this. The code base is too large to load, but I will explain in detail what is happening:
I have a class ProgessBarthat is JDialogcontaining a swing JProgressBar. I have some getters and setters that change the bar to my liking, however there is a problem.
ProgressBar is generated inside the method myButtonActionPerformed
myButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
myButtonActionPerformed(evt);
}
});
when the user clicks on this button, processing begins and appears ProgressBar.
The user currently has JFrame, and this progress bar is displayed in JDialog. After going through the debugging mode in Netbeans, I see that the values JProgressBarchange, but the bar visually stays at 0% while my program is processing, and then instantly switches to 100% the moment it leaves the add action listening method above, almost like as if he was expecting a redraw while out of this listener. What? I do not understand? Is there something I can name that will make it update inside this method myButtonActionPerformed, and not wait until it is useless.
source
share