Results 1 to 1 of 1
Thread: SWT RowLayout Demo
-
SWT RowLayout Demo
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.layout.RowData; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Shell; public class RowLayoutSample { Display display = new Display(); Shell shell = new Shell(display); public RowLayoutSample() { RowLayout rowLayout = new RowLayout(); //rowLayout.fill = true; //rowLayout.justify = true; //rowLayout.pack = false; //rowLayout.type = SWT.VERTICAL; //rowLayout.wrap = false; shell.setLayout(rowLayout); Button button1 = new Button(shell, SWT.PUSH); button1.setText("button1"); button1.setLayoutData(new RowData(100, 35)); List list = new List(shell, SWT.BORDER); list.add("item 1"); list.add("item 2"); list.add("item 3"); Button button2 = new Button(shell, SWT.PUSH); button2.setText("button #2"); //shell.setSize(120, 120); shell.pack(); shell.open(); // 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 RowLayoutSample(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
SWT GridLayout Demo
By Java Tip in forum SWTReplies: 0Last Post: 07-11-2008, 04:48 PM -
JDesktopPane demo
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:43 PM -
AffineTransform demo
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 10:59 PM -
Transform Demo
By Java Tip in forum java.awtReplies: 0Last Post: 06-21-2008, 08:52 PM -
If Else Demo
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:04 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks