All Things Techie With Huge, Unstructured, Intuitive Leaps
Showing posts with label dialog. Show all posts
Showing posts with label dialog. Show all posts

SWT Dialog To Front

I am working in org.eclipse.swt Java.  I create a dialog box.  The app was full screen and I didn't have any minimize corners on the screen.  I created a password dialog with code using the following:

PasswordDialog dialog = new PasswordDialog(new Shell());

When I ran the code, the main window was up front the the dialog was behind it. I knew this because the only way that I could see it, was with a task manager.

What to do?  I searched for a .toFront() method to no avail.  Finally I happened on the SWT.ON_TOP integer to use in the constructor, like this:

PasswordDialog dialog = new PasswordDialog(new Shell(SWT.ON_TOP));

Worked like a charm.  Hope this helps someone.

Java SWT Dialog won't open

I created a jface dialog with SWT.  When I tried to run it, everything was fine until I called a "dialog.open()".

I got the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/commands/common/EventManager

The fix was simple.  I went to this website:

http://www.jarfinder.com/index.php/jars/versionInfo/19775

and I downloaded the commands.jar.

commands-3.3.0-I20070605-0010.jar

download : http://mirrors.ibiblio.org/pub/mirrors/maven2/org/eclipse/core/commands/3.3.0-I20070605-0010/commands-3.3.0-I20070605-0010.jar

md5 hash : e762e07da9f9b4937d119c9800598a8f
size : 103384 bytes

I added the jar to the project and worked like a charm.  Hope this helps someone.