ScrolledForm from a Main() method [message #69453] |
Wed, 25 May 2005 18:18 |
Eclipse User |
|
|
|
Originally posted by: dgallery.accessor.com
Is it possible to created a ScrolledForm from a main method? The
following code compiles and executes, but the window comes up blank.
Thanks!
package landscape.views.forms;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
public class LayOuter {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Main Layout");
LayOuter layoutDude = new LayOuter();
FormToolkit toolkit = new FormToolkit(display);
ScrolledForm form = toolkit.createScrolledForm(shell);
form.setText("Landscape Forms");
Composite body = form.getBody();
GridLayout layout = new GridLayout();
body.setLayout(layout);
layout.numColumns = 2;
Button button = toolkit.createButton(body,"A checkbox in a scrollable
form", SWT.CHECK);
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.09079 seconds