Progress monitor is blank

K

kaith

I use a progress monitor to show progress while a tabbed pane is
initialized. As soon as I hit the tab the popup for progressMonitor
comes up but it is blank. What am i doing wrong?
 
J

Jonathan Mcdougall

I use a progress monitor to show progress while a tabbed pane is
initialized. As soon as I hit the tab the popup for progressMonitor
comes up but it is blank. What am i doing wrong?

There is a problem on line 124.


Jonathan
 
R

Robert Olofsson

kaith ([email protected]) wrote:
: I use a progress monitor to show progress while a tabbed pane is
: initialized. As soon as I hit the tab the popup for progressMonitor
: comes up but it is blank. What am i doing wrong?

Most probably you do the work in the AWT thread. If you have a lengty
operation do it in another thread....

/robo
 
T

Tr0mBoNe-

Dave Glasser said:

you must make sure that the inputs to progress monitor are correct. A
NULL value where there is supposed to be information would be an
issue. Also, if your progress meter is run by values derived by the
program as to how far along in the boot up process it is, print them
to the console as debugging statements. If not, then you need to
create data for the progress meter to parse and show. This can be done
a number of ways, but the easiest is with a little snippet of code
like this:

//in an inner class, most likely in the constructor for the
JTabbedPane
public ProgressTimer()
{
class TimeMover implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
//do your progress incrementation or whatever you need
to do
}
}
TimeMover listener = new TimeMover();

final int DELAY = 10; //number of miliseconds.
Timer t = new Timer(DELAY, listener);
t.start();
}

now this is just a basic timer class that will do nothing every 10
miliseconds. You have to decide how fast the progress meter will go,
or if it will run just an image that animates (thats what i would do)
and stops when the JTabbedPane is done paneing.

I hope that this gets you going.

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top