JProgressBar issue

E

EdUarDo

Hi there. In a class that extends from JApplet I have some panels with
several components like JTree (within a JScrollPane), a JList, some
combo boxes, etc...

When the user select an option from a combo, the applet access to a database
and load data into the JTree and JList components. What I want is to show
a JProgressBar with indeterminate finish time, while data is being load.

I know how to create an indeterminate JProgressBar:

JProgressBar bar = new JProgressBar();
bar.setStringPainted(true);
bar.setString("");
bar.setIndeterminate(true);

and I add it to my applet when user change the selected item from a combo box:

this.getContentPane().add(bar);

But the bar it isn't shown. What am I doing wrong?
 
A

Andrew Thompson

Hi there. In a class that extends from JApplet
URL?

...I have some panels with
several components like JTree (within a JScrollPane), a JList,

BTW said:
..some combo boxes, etc...

When the user select an option from a combo, the applet access to a database
and load data into the JTree and JList components. What I want is to show
a JProgressBar with indeterminate finish time, while data is being load. ...
But the bar it isn't shown. What am I doing wrong?

Attempting to update the GUI from within the EDT, most probably.
<http://www.physci.org/guifaq.jsp#2.1>
<http://www.physci.org/guifaq.jsp#2.2>

HTH
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top