1 | /*
|
---|
2 | * SWT009_02.java
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (c) 2002, 2005 EclipseOS2 Team.
|
---|
7 | * This file is made available under the terms of the Common Public License v1.0
|
---|
8 | * which accompanies this distribution, and is available at
|
---|
9 | * http://www.eclipse.org/legal/cpl-v10.html
|
---|
10 | */
|
---|
11 |
|
---|
12 | import org.eclipse.swt.widgets.Display;
|
---|
13 | import org.eclipse.swt.widgets.Label;
|
---|
14 | import org.eclipse.swt.widgets.Shell;
|
---|
15 | import org.eclipse.swt.SWT;
|
---|
16 | import org.eclipse.swt.widgets.*;
|
---|
17 | import org.eclipse.swt.layout.FillLayout;
|
---|
18 | import org.eclipse.swt.graphics.*;
|
---|
19 |
|
---|
20 | public class SWT009_02 extends SWTTestCase {
|
---|
21 |
|
---|
22 | static {
|
---|
23 | STEP = "009";
|
---|
24 | TEST = "02";
|
---|
25 | DESC = "Text";
|
---|
26 | }
|
---|
27 |
|
---|
28 | Shell createTopShell(Display display) {
|
---|
29 | return new Shell(display, SWT.SHELL_TRIM | SWT.NO_REDRAW_RESIZE);
|
---|
30 | }
|
---|
31 |
|
---|
32 |
|
---|
33 | void initComponents() {
|
---|
34 | shell.setText("Hello World Text");
|
---|
35 | shell.setSize(300, 300);
|
---|
36 | final Text text1 = new Text(shell, SWT.MULTI | SWT.V_SCROLL);
|
---|
37 | text1.setBounds(100, 50, 100, 70);
|
---|
38 | final Text text2 = new Text(shell, SWT.SINGLE | SWT.BORDER);
|
---|
39 | text2.setBounds(100, 160, 100, 25);
|
---|
40 | text1.setText("HOLA");
|
---|
41 | text2.setText("HELLO");
|
---|
42 | System.out.println("Length = " + text1.getCharCount());
|
---|
43 | System.out.println("Text = " + text1.getText());
|
---|
44 | shell.open();
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | void setTitle(String title) {
|
---|
49 | super.setTitle(title);
|
---|
50 | }
|
---|
51 |
|
---|
52 | public static void main(String[] args) {
|
---|
53 | go(new SWT009_02());
|
---|
54 | }
|
---|
55 |
|
---|
56 | }
|
---|