| Author |
How to Resize ProgressMonitor? How to display the message/note in two lines in progress monitor?
|
Hemanth Kumar Simhadri
Greenhorn
Joined: Apr 22, 2010
Posts: 29
|
|
I am facing some problem with Progress Monitor. My Progress Monitor Displays a dynamic message which increases in length. Because of this, the message is getting truncated (cutting off) at the end and the message is not shown completely. The size of the progress monitor is not increasing dynamically along with the text. Is it possible to display the message in two lines in the progress monitor?
My actual code is like this:
ProgressMonitor progressMonitor = new ProgressMonitor(context.getMyParentFrame(),
"PM Search in progress...",
"Calculating file numbers...",
0, 100);
progressMonitor.setMillisToDecideToPopup(0);
progressMonitor.setMillisToPopup(0);
progressMonitor.setProgress(1);
note = "Searching file " + currentFileNumber +
"/" + totalNumberOfFiles + "... Found " +
(searchResults.size() + results.size()) +
" records...";
progressMonitor.setNote(note);
In the above note currentFileNumber, searchResults.size() and results.size() are the dynamic numbers
I tried to display the message in two lines in this way:
note = "Searching file " + currentFileNumber +
"/" + totalNumberOfFiles+"...";
note += "\n"+"Found " +
(searchResults.size() + results.size()) +
" records...";
But this didn't worked. So I again tried by embedding the line break of HTML in progress monitor note like this:
<html> <br></br></html>
This also didn't worked. Please help in this
|
 |
Peter Taucher
Ranch Hand
Joined: Nov 18, 2006
Posts: 174
|
|
HTML code works in a ProgressMonitor (the note is simply a JLabel). To alter the private dialog's size is although another matter. To achieve such a behaviour you'd have to implement your own ProgressMonitor like mentioned here:
http://www.coderanch.com/t/457018/GUI/java/Change-size-progress-monitor
|
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
|
 |
Erik Pathin
Greenhorn
Joined: Mar 29, 2011
Posts: 1
|
|
Hi,
Your problem is probably solved already, but here is a simple way to do it :
The ProgressMonitor sizes to the length of the title string, but doesnt show the \t at the end.
|
 |
 |
|
|
subject: How to Resize ProgressMonitor? How to display the message/note in two lines in progress monitor?
|
|
|