How can I change the title of a ProgressMonitor in Java?

398 Views Asked by At

ProgressMonitor progressMonitor = new ProgressMonitor(frame, "", "", 0, 100);

  • progressMonitor.setProgress(0);
  • ...
  • progressMonitor.setProgress(100);

This works fine for me, but now I want to change the title of this progress monitor. Currently its "Progress...".

2

There are 2 best solutions below

0
Thomas On BEST ANSWER

You can set the title of the dialog window through the UIManager:

String title = "Foobar";
UIManager.put("ProgressMonitor.progressText", title);
ProgressMonitor progressMonitor = new ProgressMonitor(frame, "", "", 0, 100);
...

enter image description here

0
ergonaut On

You can do this:

monitor.beginTask("Running Job..", IProgressMonitor.UNKNOWN);
monitor.beginTask("Job #1");

But I don't believe the actual title of the box can change.