Implementing progress indicator

Hi,
what is the best way to implement progress indicator, which will be in indeterminate state?
In my case I have:
new Task.Backgroundable(project, "Keep", false) {
public boolean shouldStartInBackground() {
return false;
}

public void processSentToBackground() {
super.processSentToBackground();
}

public void processRestoredToForeground() {
super.processRestoredToForeground();
}

public void run(ProgressIndicator indicator) {
indicator.setText("Keep");
indicator.setIndeterminate(true);
//performing some operations
}
}.setCancelText("Stop loading").queue();

In fact I receive here a progress bar which can be put to background via button 'Background'. If I run this code I have a progress bar, but indicator can't be seen, only when I click on 'Background' button, progress indicator appears (I don't need any percents in my case, just indicator which will indicate that process is running). See the picture attached. Why indicator is shown only in background mode? What am I doing wrong?


My task is to implement indicator similar to the one we have in IntelliJ during compilation of sources.



Attachment(s):
untitled.bmp

Please sign in to leave a comment.