1. java jprogressbar hangs during heavy operation stackoverflow.comI'm writing a java program and, before I call a method that makes heavy use of the CPU, I display a frame with a JProgressBar on it. Although I display it ... |
2. Progress bar hangs out. coderanch.comimport java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.Timer; public class ProgressBarTest { public static void main(String[] args) { ClassWithProgressBar cwpb = new ClassWithProgressBar(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(cwpb.getStatusPanel(), "South"); f.setSize(300,100); f.setLocation(200,200); f.setVisible(true); } } class ClassWithProgressBar { JProgressBar progressBar; int taskLength = 32; int count = 0; public ClassWithProgressBar() { TaskMonitor tm = new TaskMonitor(this); tm.timer.start(); startLongTask(); } private ... |