O'Reilly logo

Java™ After Hours: 10 Projects You'll Never Do at Work by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an SWT Application

To create the Browser project, you're going to have to know how SWT applications work. Take a look at Figure 8.2, where you'll see just about the simplest such application. It just displays the text “An SWT label, very cool.” in an SWT Label widget inside an SWT window.

Figure 8.2. An SWT application.

This application, LabelProject.java, starts importing the SWT classes it needs and creating a new LabelProject object in the main method:

					import org.eclipse.swt.*;
					import org.eclipse.swt.widgets.*;
public class LabelProject
{
        public static void main(String [] args)
					{
					new LabelProject();
					}
        .
        .
        .
}

In the constructor, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required