Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » can not find main (was swt and eclipse)
can not find main (was swt and eclipse) [message #442494] Sat, 04 September 2004 14:38
Jeff Kish is currently offline Jeff KishFriend
Messages: 5
Registered: July 2009
Junior Member
I'm trying to run the swt sample.

I'm getting a error when
I try to activate the run configuration:

First a popup:
title: Java Virtual Machine Launcher
body: Could not find the main class. Program will exit.

then on the Console tab:
java.lang.NoClassDefFoundError: swt/win32_3/0/0/os//x86
exception in thread "main"

It seems obvious what the problem is, but as I used the "search" button when
putting together the run configuration to find the main class. I'm not sure
what I bolluxed up.

Thanks for any hints,

My program seems to build ok:

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

/*
* Created on Sep 1, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/

/**
* @author jeff kish
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class HelloWorld {

public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Label label = new Label (shell, SWT.CENTER);
label.setText ("Hello_world");
label.setBounds (shell.getClientArea ());
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}

Jeff Kish
Previous Topic:NetBeans-like GUI builder for SWT ?
Next Topic:forms in embedded mozilla browser
Goto Forum:
  


Current Time: Fri Apr 26 08:16:33 GMT 2024

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

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

Back to the top