summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2010-10-28 21:41:33 +0000
committerBogdan Gheorghe <gheorghe>2010-10-28 21:41:33 +0000
commit415aa083315132f46d60c2d6116c8412c62be014 (patch)
tree6e221e37021c6bcce780f255797b499a1fd9df9c
parent211feceb33194c03f2d7959fda2411f8cac53fa7 (diff)
downloadeclipse.platform.swt-415aa083315132f46d60c2d6116c8412c62be014.tar.gz
eclipse.platform.swt-415aa083315132f46d60c2d6116c8412c62be014.tar.xz
eclipse.platform.swt-415aa083315132f46d60c2d6116c8412c62be014.zip
*** empty log message ***
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet346.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet346.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet346.java
new file mode 100644
index 0000000000..cfe8b5c72a
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet346.java
@@ -0,0 +1,43 @@
+//
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/*
+ * Text snippet: set text in a secure manner.
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ */
+public class Snippet346 {
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ shell.setText("Snippet 346");
+
+ Text text = new Text(shell, SWT.PASSWORD | SWT.BORDER);
+ text.setTextChars(new char[]{'p','a','s','s'});
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+}