Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Hint on ProgressIndicator
Hint on ProgressIndicator [message #463195] Sat, 29 October 2005 09:56 Go to next message
chris is currently offline chrisFriend
Messages: 72
Registered: July 2009
Member
Hi,

I'm just starting to learn SWT/JFace (and actually I don't have too much
experience with other GUI toolkits like Swing or AWT, so please forgive
me if my question is not that smart :-) ).

I'm trying to display a progress bar. I'd like to use the JFace
ProgressIndicator class, but for some reason the indicator doesn't show
up in the shell... Can somebody give me a hint why? Below's my snippet.

Thanks in advance,
Chris


package de.xyz.test;

import org.eclipse.jface.dialogs.ProgressIndicator;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ProgressIndicatorTest
{
public static void main(String[] args) throws InterruptedException
{
Display display = Display.getDefault();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
ProgressIndicator progressIndicator = new ProgressIndicator(shell);
progressIndicator.setSize(200, 20);
progressIndicator.pack();
shell.pack();
shell.open();

progressIndicator.beginAnimatedTask();
Thread.sleep(5000);
progressIndicator.done();

while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
Re: Hint on ProgressIndicator [message #463196 is a reply to message #463195] Sat, 29 October 2005 15:31 Go to previous message
chris is currently offline chrisFriend
Messages: 72
Registered: July 2009
Member
Hi again,

oops - I got it. For some weird reason I expected the ProgressIndicator
to run in a different thread, but finally I noticed in the debugger that
there was just one thread and I was blocking it myself.

Sorry for wasting your time - stay tuned for hopefully smarter questions :-)

Chris
Previous Topic:Custom Event Handlers
Next Topic:Radio button and wrapping label
Goto Forum:
  


Current Time: Sun Dec 21 15:24:49 GMT 2014

Powered by FUDForum. Page generated in 0.01574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software