Results 1 to 1 of 1
Thread: ViewForm Example
-
ViewForm Example
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ViewForm; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; /** * */ public class ViewFormExample { Display display = new Display(); Shell shell = new Shell(display); public ViewFormExample() { shell.setLayout(new FillLayout()); final ViewForm viewForm = new ViewForm(shell, SWT.BORDER); Label label = new Label(viewForm, SWT.NULL); label.setText("Top center"); viewForm.setTopCenter(label); shell.setSize(400, 200); shell.open(); //textUser.forceFocus(); // Set up the event loop. while (!shell.isDisposed()) { if (!display.readAndDispatch()) { // If no more entries in event queue display.sleep(); } } display.dispose(); } private void init() { } public static void main(String[] args) { new ViewFormExample(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks