source: trunk/tests/SWT/java/SWT009_02.java

Last change on this file was 12, checked in by lpino, 18 years ago
  • Initial commit
File size: 1.5 KB
Line 
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
12import org.eclipse.swt.widgets.Display;
13import org.eclipse.swt.widgets.Label;
14import org.eclipse.swt.widgets.Shell;
15import org.eclipse.swt.SWT;
16import org.eclipse.swt.widgets.*;
17import org.eclipse.swt.layout.FillLayout;
18import org.eclipse.swt.graphics.*;
19
20public 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}
Note: See TracBrowser for help on using the repository browser.