<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSWT_JFace_Eclipse%2FEvent</id>
		<title>Java/SWT JFace Eclipse/Event - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSWT_JFace_Eclipse%2FEvent"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/Event&amp;action=history"/>
		<updated>2026-04-22T01:51:12Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/Event&amp;diff=5640&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/Event&amp;diff=5640&amp;oldid=prev"/>
				<updated>2010-06-01T05:55:20Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 05:55, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/Event&amp;diff=5639&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/Event&amp;diff=5639&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Demonstrates ControlListeners ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.graphics.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates ControlListeners&lt;br /&gt;
 */&lt;br /&gt;
public class ControlListenerExample {&lt;br /&gt;
  /**&lt;br /&gt;
   * Runs the application&lt;br /&gt;
   */&lt;br /&gt;
  public void run() {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    Image image = new Image(display, &amp;quot;jexp.gif&amp;quot;);&lt;br /&gt;
    createContents(shell, image);&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    if (image != null) image.dispose();&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates the main window&amp;quot;s contents&lt;br /&gt;
   * &lt;br /&gt;
   * @param shell the main window&lt;br /&gt;
   * @param image the image&lt;br /&gt;
   */&lt;br /&gt;
  private void createContents(Shell shell, Image image) {&lt;br /&gt;
    shell.setLayout(new GridLayout());&lt;br /&gt;
    // Create a label to hold the image&lt;br /&gt;
    Label label = new Label(shell, SWT.NONE);&lt;br /&gt;
    label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));&lt;br /&gt;
    label.setImage(image);&lt;br /&gt;
    shell.setData(label);&lt;br /&gt;
    // Add the listener&lt;br /&gt;
    shell.addControlListener(new ControlAdapter() {&lt;br /&gt;
      public void controlResized(ControlEvent event) {&lt;br /&gt;
        // Get the event source (the shell)&lt;br /&gt;
        Shell shell = (Shell) event.getSource();&lt;br /&gt;
        // Get the source&amp;quot;s data (the label)&lt;br /&gt;
        Label label = (Label) shell.getData();&lt;br /&gt;
        // Determine how big the shell should be to fit the image&lt;br /&gt;
        Rectangle rect = shell.getClientArea();&lt;br /&gt;
        ImageData data = label.getImage().getImageData();&lt;br /&gt;
        // If the shell is too small, hide the image&lt;br /&gt;
        if (rect.width &amp;lt; data.width || rect.height &amp;lt; data.height) {&lt;br /&gt;
          shell.setText(&amp;quot;Too small.&amp;quot;);&lt;br /&gt;
          label.setText(&amp;quot;I&amp;quot;m melting!&amp;quot;);&lt;br /&gt;
        } else {&lt;br /&gt;
          // He fits!&lt;br /&gt;
          shell.setText(&amp;quot;Happy Guy Fits!&amp;quot;);&lt;br /&gt;
          label.setImage(label.getImage());&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new ControlListenerExample().run();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demonstrates FocusListener ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates FocusListener&lt;br /&gt;
 */&lt;br /&gt;
public class FocusListenerExample {&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    // Create the shell&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setLayout(new GridLayout(3, true));&lt;br /&gt;
    shell.setText(&amp;quot;One Potato, Two Potato&amp;quot;);&lt;br /&gt;
    // Create the focus listener&lt;br /&gt;
    FocusListener listener = new FocusListener() {&lt;br /&gt;
      public void focusGained(FocusEvent event) {&lt;br /&gt;
        Button button = (Button) event.getSource();&lt;br /&gt;
        button.setText(&amp;quot;I&amp;quot;m It!&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      public void focusLost(FocusEvent event) {&lt;br /&gt;
        Button button = (Button) event.getSource();&lt;br /&gt;
        button.setText(&amp;quot;Pick Me!&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    };&lt;br /&gt;
    // Create the buttons and add the listener to each one&lt;br /&gt;
    for (int i = 0; i &amp;lt; 6; i++) {&lt;br /&gt;
      Button button = new Button(shell, SWT.PUSH);&lt;br /&gt;
      button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));&lt;br /&gt;
      button.setText(&amp;quot;Pick Me!&amp;quot;);&lt;br /&gt;
      button.addFocusListener(listener);&lt;br /&gt;
    }&lt;br /&gt;
    // Display the window&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demonstrates LineBackgroundListeners ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.custom.*;&lt;br /&gt;
import org.eclipse.swt.graphics.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates LineBackgroundListeners&lt;br /&gt;
 */&lt;br /&gt;
public class LineBackgroundListenerTest {&lt;br /&gt;
  // The color to use for backgrounds&lt;br /&gt;
  Color red;&lt;br /&gt;
  /**&lt;br /&gt;
   * Runs the application&lt;br /&gt;
   */&lt;br /&gt;
  public void run() {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    red = display.getSystemColor(SWT.COLOR_RED);&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    createContents(shell);&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates the main window&amp;quot;s contents&lt;br /&gt;
   * &lt;br /&gt;
   * @param shell the main window&lt;br /&gt;
   */&lt;br /&gt;
  private void createContents(Shell shell) {&lt;br /&gt;
    shell.setLayout(new FillLayout());&lt;br /&gt;
    StyledText styledText = new StyledText(shell, SWT.BORDER);&lt;br /&gt;
    // Add the line background listener&lt;br /&gt;
    styledText.addLineBackgroundListener(new LineBackgroundListener() {&lt;br /&gt;
      public void lineGetBackground(LineBackgroundEvent event) {&lt;br /&gt;
        if (event.lineText.indexOf(&amp;quot;SWT&amp;quot;) &amp;gt; -1) {&lt;br /&gt;
          event.lineBackground = red;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new LineBackgroundListenerTest().run();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demonstrates mouse events ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates mouse events&lt;br /&gt;
 */&lt;br /&gt;
public class MouseEventExample implements MouseListener, MouseMoveListener,&lt;br /&gt;
    MouseTrackListener {&lt;br /&gt;
  // The label to hold the messages from mouse events&lt;br /&gt;
  Label myLabel = null;&lt;br /&gt;
  /**&lt;br /&gt;
   * MouseEventExample constructor&lt;br /&gt;
   * &lt;br /&gt;
   * @param shell the shell&lt;br /&gt;
   */&lt;br /&gt;
  public MouseEventExample(Shell shell) {&lt;br /&gt;
    myLabel = new Label(shell, SWT.BORDER);&lt;br /&gt;
    myLabel.setText(&amp;quot;I ain&amp;quot;t afraid of any old mouse&amp;quot;);&lt;br /&gt;
    shell.addMouseListener(this);&lt;br /&gt;
    shell.addMouseMoveListener(this);&lt;br /&gt;
    shell.addMouseTrackListener(this);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    // Create the window&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setLayout(new GridLayout());&lt;br /&gt;
    shell.setSize(450, 200);&lt;br /&gt;
    shell.setText(&amp;quot;Mouse Event Example&amp;quot;);&lt;br /&gt;
    // Create the listener&lt;br /&gt;
    MouseEventExample myMouseEventExample = new MouseEventExample(shell);&lt;br /&gt;
    // Display the window&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user double-clicks the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseDoubleClick(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Double Click &amp;quot; + e.button + &amp;quot; at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user clicks the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseDown(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Button &amp;quot; + e.button + &amp;quot; Down at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user releases the mouse after clicking&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseUp(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Button &amp;quot; + e.button + &amp;quot; Up at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user moves the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseMove(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Mouse Move at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user enters the shell with the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseEnter(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Mouse Enter at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user exits the shell with the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseExit(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Mouse Exit at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user hovers the mouse&lt;br /&gt;
   */&lt;br /&gt;
  public void mouseHover(MouseEvent e) {&lt;br /&gt;
    myLabel.setText(&amp;quot;Mouse Hover at: &amp;quot; + e.x + &amp;quot;,&amp;quot; + e.y);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demonstrates various listeners ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates various listeners&lt;br /&gt;
 */&lt;br /&gt;
public class MultipleListenersExample implements HelpListener, VerifyListener,&lt;br /&gt;
    ModifyListener {&lt;br /&gt;
  // Constants used for conversions&lt;br /&gt;
  private static final double FIVE_NINTHS = 5.0 / 9.0;&lt;br /&gt;
  private static final double NINE_FIFTHS = 9.0 / 5.0;&lt;br /&gt;
  // Widgets used in the window&lt;br /&gt;
  private Text fahrenheit;&lt;br /&gt;
  private Text celsius;&lt;br /&gt;
  private Label help;&lt;br /&gt;
  /**&lt;br /&gt;
   * Runs the application&lt;br /&gt;
   */&lt;br /&gt;
  public void run() {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setText(&amp;quot;Temperatures&amp;quot;);&lt;br /&gt;
    createContents(shell);&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Create the main window&amp;quot;s contents&lt;br /&gt;
   * @param shell the main window&lt;br /&gt;
   */&lt;br /&gt;
  private void createContents(Shell shell) {&lt;br /&gt;
    shell.setLayout(new GridLayout(3, true));&lt;br /&gt;
    // Create the label and input box for Fahrenheit&lt;br /&gt;
    new Label(shell, SWT.LEFT).setText(&amp;quot;Fahrenheit:&amp;quot;);&lt;br /&gt;
    fahrenheit = new Text(shell, SWT.BORDER);&lt;br /&gt;
    GridData data = new GridData(GridData.FILL_HORIZONTAL);&lt;br /&gt;
    data.horizontalSpan = 2;&lt;br /&gt;
    fahrenheit.setLayoutData(data);&lt;br /&gt;
    // Set the context-sensitive help&lt;br /&gt;
    fahrenheit.setData(&amp;quot;Type a temperature in Fahrenheit&amp;quot;);&lt;br /&gt;
    // Add the listeners&lt;br /&gt;
    fahrenheit.addHelpListener(this);&lt;br /&gt;
    fahrenheit.addVerifyListener(this);&lt;br /&gt;
    fahrenheit.addModifyListener(this);&lt;br /&gt;
    // Create the label and input box for Celsius&lt;br /&gt;
    new Label(shell, SWT.LEFT).setText(&amp;quot;Celsius:&amp;quot;);&lt;br /&gt;
    celsius = new Text(shell, SWT.BORDER);&lt;br /&gt;
    data = new GridData(GridData.FILL_HORIZONTAL);&lt;br /&gt;
    data.horizontalSpan = 2;&lt;br /&gt;
    celsius.setLayoutData(data);&lt;br /&gt;
    // Set the context-sensitive help&lt;br /&gt;
    celsius.setData(&amp;quot;Type a temperature in Celsius&amp;quot;);&lt;br /&gt;
    // Add the listeners&lt;br /&gt;
    celsius.addHelpListener(this);&lt;br /&gt;
    celsius.addVerifyListener(this);&lt;br /&gt;
    celsius.addModifyListener(this);&lt;br /&gt;
    // Create the area for help&lt;br /&gt;
    help = new Label(shell, SWT.LEFT | SWT.BORDER);&lt;br /&gt;
    data = new GridData(GridData.FILL_HORIZONTAL);&lt;br /&gt;
    data.horizontalSpan = 3;&lt;br /&gt;
    help.setLayoutData(data);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when user requests help&lt;br /&gt;
   */&lt;br /&gt;
  public void helpRequested(HelpEvent event) {&lt;br /&gt;
    // Get the help text from the widget and set it into the help label&lt;br /&gt;
    help.setText((String) event.widget.getData());&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when the user types into a text box, but before the text box gets&lt;br /&gt;
   * what the user typed&lt;br /&gt;
   */&lt;br /&gt;
  public void verifyText(VerifyEvent event) {&lt;br /&gt;
    // Assume we don&amp;quot;t allow it&lt;br /&gt;
    event.doit = false;&lt;br /&gt;
    // Get the character typed&lt;br /&gt;
    char myChar = event.character;&lt;br /&gt;
    String text = ((Text) event.widget).getText();&lt;br /&gt;
    // Allow &amp;quot;-&amp;quot; if first character&lt;br /&gt;
    if (myChar == &amp;quot;-&amp;quot; &amp;amp;&amp;amp; text.length() == 0) event.doit = true;&lt;br /&gt;
    // Allow 0-9&lt;br /&gt;
    if (Character.isDigit(myChar)) event.doit = true;&lt;br /&gt;
    // Allow backspace&lt;br /&gt;
    if (myChar == &amp;quot;\b&amp;quot;) event.doit = true;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when the user modifies the text in a text box&lt;br /&gt;
   */&lt;br /&gt;
  public void modifyText(ModifyEvent event) {&lt;br /&gt;
    // Remove all the listeners, so we don&amp;quot;t enter any infinite loops&lt;br /&gt;
    celsius.removeVerifyListener(this);&lt;br /&gt;
    celsius.removeModifyListener(this);&lt;br /&gt;
    fahrenheit.removeVerifyListener(this);&lt;br /&gt;
    fahrenheit.removeModifyListener(this);&lt;br /&gt;
    // Get the widget whose text was modified&lt;br /&gt;
    Text text = (Text) event.widget;&lt;br /&gt;
    try {&lt;br /&gt;
      // Get the modified text&lt;br /&gt;
      int temp = Integer.parseInt(text.getText());&lt;br /&gt;
      // If they modified fahrenheit, convert to Celsius&lt;br /&gt;
      if (text == fahrenheit) {&lt;br /&gt;
        celsius.setText(String.valueOf((int) (FIVE_NINTHS * (temp - 32))));&lt;br /&gt;
      } else {&lt;br /&gt;
        // Convert to fahrenheit&lt;br /&gt;
        fahrenheit.setText(String.valueOf((int) (NINE_FIFTHS * temp + 32)));&lt;br /&gt;
      }&lt;br /&gt;
    } catch (NumberFormatException e) { /* Ignore */ }&lt;br /&gt;
    // Add the listeners back&lt;br /&gt;
    celsius.addVerifyListener(this);&lt;br /&gt;
    celsius.addModifyListener(this);&lt;br /&gt;
    fahrenheit.addVerifyListener(this);&lt;br /&gt;
    fahrenheit.addModifyListener(this);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new MultipleListenersExample().run();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Listener Example ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.KeyEvent;&lt;br /&gt;
import org.eclipse.swt.events.KeyListener;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.layout.RowLayout;&lt;br /&gt;
import org.eclipse.swt.widgets.rubo;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class KeyListenerExample {&lt;br /&gt;
  Display d;&lt;br /&gt;
  Shell s;&lt;br /&gt;
  KeyListenerExample() {&lt;br /&gt;
    d = new Display();&lt;br /&gt;
    s = new Shell(d);&lt;br /&gt;
    s.setSize(250, 200);&lt;br /&gt;
    &lt;br /&gt;
    s.setText(&amp;quot;A KeyListener Example&amp;quot;);&lt;br /&gt;
    s.setLayout(new RowLayout());&lt;br /&gt;
    final Combo c = new Combo(s, SWT.DROP_DOWN | SWT.BORDER);&lt;br /&gt;
    c.add(&amp;quot;Lions&amp;quot;);&lt;br /&gt;
    c.add(&amp;quot;Tigers&amp;quot;);&lt;br /&gt;
    c.add(&amp;quot;Bears&amp;quot;);&lt;br /&gt;
    c.add(&amp;quot;Oh My!&amp;quot;);&lt;br /&gt;
    c.addKeyListener(new KeyListener() {&lt;br /&gt;
      String selectedItem = &amp;quot;&amp;quot;;&lt;br /&gt;
      public void keyPressed(KeyEvent e) {&lt;br /&gt;
        if (c.getText().length() &amp;gt; 0) {&lt;br /&gt;
          return;&lt;br /&gt;
        }&lt;br /&gt;
        String key = Character.toString(e.character);&lt;br /&gt;
        String[] items = c.getItems();&lt;br /&gt;
        for (int i = 0; i &amp;lt; items.length; i++) {&lt;br /&gt;
          if (items[i].toLowerCase().startsWith(key.toLowerCase())) {&lt;br /&gt;
            c.select(i);&lt;br /&gt;
            selectedItem = items[i];&lt;br /&gt;
            return;&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      public void keyReleased(KeyEvent e) {&lt;br /&gt;
        if (selectedItem.length() &amp;gt; 0)&lt;br /&gt;
          c.setText(selectedItem);&lt;br /&gt;
        selectedItem = &amp;quot;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    s.open();&lt;br /&gt;
    while (!s.isDisposed()) {&lt;br /&gt;
      if (!d.readAndDispatch())&lt;br /&gt;
        d.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    d.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  public static void main() {&lt;br /&gt;
    new KeyListenerExample();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ModifyEvent: Temperature Converter JFace ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************&lt;br /&gt;
 * Copyright (c) 1998, 2004 Jackwind Li Guojie&lt;br /&gt;
 * All right reserved. &lt;br /&gt;
 * &lt;br /&gt;
 * Created on Jan 16, 2004 8:05:36 PM by JACK&lt;br /&gt;
 * $Id$&lt;br /&gt;
 * &lt;br /&gt;
 * visit: http://www.asprise.ru/swt&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
import org.eclipse.jface.window.ApplicationWindow;&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.ModifyEvent;&lt;br /&gt;
import org.eclipse.swt.events.ModifyListener;&lt;br /&gt;
import org.eclipse.swt.layout.GridLayout;&lt;br /&gt;
import org.eclipse.swt.widgets.ruposite;&lt;br /&gt;
import org.eclipse.swt.widgets.Control;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Label;&lt;br /&gt;
import org.eclipse.swt.widgets.Text;&lt;br /&gt;
public class TemperatureConverterJFace extends ApplicationWindow {&lt;br /&gt;
  Label fahrenheitLabel;&lt;br /&gt;
  Label celsiusLabel;&lt;br /&gt;
  Text fahrenheitValue;&lt;br /&gt;
  Text celsiusValue;  &lt;br /&gt;
  &lt;br /&gt;
  public TemperatureConverterJFace() {&lt;br /&gt;
    super(null);&lt;br /&gt;
    &lt;br /&gt;
    addStatusLine();&lt;br /&gt;
  }&lt;br /&gt;
  /* (non-Javadoc)&lt;br /&gt;
   * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.ruposite)&lt;br /&gt;
   */&lt;br /&gt;
  protected Control createContents(Composite parent) {&lt;br /&gt;
    getShell().setText(&amp;quot;JFace Temperature Converter&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    Composite converterComposite = new Composite(parent, SWT.NULL);&lt;br /&gt;
    &lt;br /&gt;
    converterComposite.setLayout(new GridLayout(4, false));&lt;br /&gt;
    fahrenheitLabel = new Label(converterComposite, SWT.NULL);&lt;br /&gt;
    fahrenheitLabel.setText(&amp;quot;Fahrenheit: &amp;quot;);&lt;br /&gt;
    fahrenheitValue = new Text(converterComposite, SWT.SINGLE | SWT.BORDER);&lt;br /&gt;
    celsiusLabel = new Label(converterComposite, SWT.NULL);&lt;br /&gt;
    celsiusLabel.setText(&amp;quot;Celsius: &amp;quot;);&lt;br /&gt;
    celsiusValue = new Text(converterComposite, SWT.SINGLE | SWT.BORDER);&lt;br /&gt;
    ModifyListener listener = new ModifyListener() {&lt;br /&gt;
      public void modifyText(ModifyEvent e) {&lt;br /&gt;
        valueChanged((Text) e.widget);&lt;br /&gt;
      }&lt;br /&gt;
    };&lt;br /&gt;
    fahrenheitValue.addModifyListener(listener);&lt;br /&gt;
    celsiusValue.addModifyListener(listener);&lt;br /&gt;
  &lt;br /&gt;
    return converterComposite;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Performs conversion when one of the text fields changes.&lt;br /&gt;
   * &lt;br /&gt;
   * @param text&lt;br /&gt;
   *            the event source&lt;br /&gt;
   */&lt;br /&gt;
  public void valueChanged(Text text) {&lt;br /&gt;
    if (!text.isFocusControl())&lt;br /&gt;
      return;&lt;br /&gt;
    if (text == fahrenheitValue) {&lt;br /&gt;
      try {&lt;br /&gt;
        double fValue = Double.parseDouble(text.getText());&lt;br /&gt;
        double cValue = (fValue - 32) / 1.8;&lt;br /&gt;
        celsiusValue.setText(Double.toString(cValue));&lt;br /&gt;
        System.out.println(&amp;quot;F -&amp;gt; C: &amp;quot; + cValue);&lt;br /&gt;
        setStatus(&amp;quot;Conversion performed successfully.&amp;quot;);&lt;br /&gt;
      } catch (NumberFormatException e) {&lt;br /&gt;
        celsiusValue.setText(&amp;quot;&amp;quot;);&lt;br /&gt;
        setStatus(&amp;quot;Invalid number format: &amp;quot; + text.getText());&lt;br /&gt;
      }&lt;br /&gt;
    } else {&lt;br /&gt;
      try {&lt;br /&gt;
        double cValue = Double.parseDouble(text.getText());&lt;br /&gt;
        double fValue = cValue * 1.8 + 32;&lt;br /&gt;
        fahrenheitValue.setText(Double.toString(fValue));&lt;br /&gt;
        System.out.println(&amp;quot;C -&amp;gt; F: &amp;quot; + fValue);&lt;br /&gt;
        setStatus(&amp;quot;Conversion performed successfully.&amp;quot;);&lt;br /&gt;
      } catch (NumberFormatException e) {&lt;br /&gt;
        fahrenheitValue.setText(&amp;quot;&amp;quot;);&lt;br /&gt;
        setStatus(&amp;quot;Invalid number format: &amp;quot; + text.getText());&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    TemperatureConverterJFace converter = new TemperatureConverterJFace();&lt;br /&gt;
    converter.setBlockOnOpen(true);&lt;br /&gt;
    converter.open();&lt;br /&gt;
    Display.getCurrent().dispose();&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mouse Event Listener  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/******************************************************************************&lt;br /&gt;
 * Copyright (c) 1998, 2004 Jackwind Li Guojie&lt;br /&gt;
 * All right reserved. &lt;br /&gt;
 * &lt;br /&gt;
 * Created on Oct 27, 2003 10:38:29 PM by JACK&lt;br /&gt;
 * $Id: ListenerTest.java,v 1.1 2003/12/22 12:07:54 jackwind Exp $&lt;br /&gt;
 * &lt;br /&gt;
 * visit: http://www.asprise.ru/swt&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Event;&lt;br /&gt;
import org.eclipse.swt.widgets.Listener;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class ListenerTest {&lt;br /&gt;
  public ListenerTest() {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setText(&amp;quot;Left click your mouse&amp;quot;);&lt;br /&gt;
    shell.setSize(200, 100);&lt;br /&gt;
    shell.open();    &lt;br /&gt;
    &lt;br /&gt;
    shell.addListener(SWT.MouseDown, new SimpleListener(&amp;quot;Shell mouse down listener&amp;quot;));&lt;br /&gt;
    &lt;br /&gt;
    display.addFilter(SWT.MouseDown, new SimpleListener(&amp;quot;Display mouse down Listener&amp;quot;));&lt;br /&gt;
    display.addFilter(SWT.MouseUp, new SimpleListener(&amp;quot;Display mouse up Listener&amp;quot;));&lt;br /&gt;
    &lt;br /&gt;
    while(! shell.isDisposed()) {&lt;br /&gt;
      if(! display.readAndDispatch()) {// If no more entries in event queue&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  class SimpleListener implements Listener{&lt;br /&gt;
    String name;&lt;br /&gt;
    &lt;br /&gt;
    public SimpleListener(String name) {&lt;br /&gt;
      this.name = name;&lt;br /&gt;
    }&lt;br /&gt;
    public void handleEvent(Event e) {&lt;br /&gt;
      System.out.println(&amp;quot;Event: [&amp;quot; + EventUtil.getEventName(e.type) + &amp;quot;] from &amp;quot; + name + &amp;quot;. \tCurrent Time (in ms):  &amp;quot; + System.currentTimeMillis());&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new ListenerTest();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SelectionListener and DisposeListener ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Send questions, comments, bug reports, etc. to the authors:&lt;br /&gt;
//Rob Warner (rwarner@interspatial.ru)&lt;br /&gt;
//Robert Harris (rbrt_harris@yahoo.ru)&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class demonstrates SelectionListener and DisposeListener&lt;br /&gt;
 */&lt;br /&gt;
public class DisposeListenerExample {&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    // Create the main window&lt;br /&gt;
    Shell mainShell = new Shell(display);&lt;br /&gt;
    mainShell.setLayout(new FillLayout());&lt;br /&gt;
    mainShell.setText(&amp;quot;Big Brother&amp;quot;);&lt;br /&gt;
    final Label mainMessage = new Label(mainShell, SWT.LEFT);&lt;br /&gt;
    mainMessage.setText(&amp;quot;Don&amp;quot;t even think about it&amp;quot;);&lt;br /&gt;
    // Create the child shell and the dispose listener&lt;br /&gt;
    final Shell childShell = new Shell(mainShell);&lt;br /&gt;
    childShell.addDisposeListener(new DisposeListener() {&lt;br /&gt;
      public void widgetDisposed(DisposeEvent event) {&lt;br /&gt;
        // When the child shell is disposed, change the message on the main shell&lt;br /&gt;
        mainMessage.setText(&amp;quot;Gotcha&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    childShell.setLayout(new FillLayout());&lt;br /&gt;
    childShell.setText(&amp;quot;little brother&amp;quot;);&lt;br /&gt;
    // Put a message on the child shell&lt;br /&gt;
    new Label(childShell, SWT.LEFT)&lt;br /&gt;
        .setText(&amp;quot;If you dispose me, my big brother&amp;quot;s gonna get you!&amp;quot;);&lt;br /&gt;
    // Add a button and a listener to the child shell&lt;br /&gt;
    Button button = new Button(childShell, SWT.PUSH);&lt;br /&gt;
    button.setText(&amp;quot;Close Me!&amp;quot;);&lt;br /&gt;
    button.addSelectionListener(new SelectionAdapter() {&lt;br /&gt;
      public void widgetSelected(SelectionEvent event) {&lt;br /&gt;
        // When the button is pressed, close the child shell&lt;br /&gt;
        childShell.close();&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    // Open the shells&lt;br /&gt;
    mainShell.open();&lt;br /&gt;
    childShell.open();&lt;br /&gt;
    while (!mainShell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch()) {&lt;br /&gt;
        display.sleep();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility class for event handling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************&lt;br /&gt;
 * Copyright (c) 1998, 2004 Jackwind Li Guojie&lt;br /&gt;
 * All right reserved. &lt;br /&gt;
 * &lt;br /&gt;
 * Created on Oct 28, 2003 12:29:41 AM by JACK&lt;br /&gt;
 * $Id: EventUtil.java,v 1.1 2003/12/22 12:07:54 jackwind Exp $&lt;br /&gt;
 * &lt;br /&gt;
 * visit: http://www.asprise.ru/swt&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
/**&lt;br /&gt;
 * Utility class for event handling.&lt;br /&gt;
 */&lt;br /&gt;
public class EventUtil {&lt;br /&gt;
  &lt;br /&gt;
  public static String getEventName(int eventType) {&lt;br /&gt;
    switch(eventType) {&lt;br /&gt;
      case SWT.None:&lt;br /&gt;
        return &amp;quot;null&amp;quot;;&lt;br /&gt;
      case SWT.KeyDown:&lt;br /&gt;
        return &amp;quot;key down&amp;quot;;&lt;br /&gt;
      case SWT.KeyUp:&lt;br /&gt;
        return &amp;quot;key up&amp;quot;;&lt;br /&gt;
      case SWT.MouseDown:&lt;br /&gt;
        return &amp;quot;mouse down&amp;quot;;&lt;br /&gt;
      case SWT.MouseUp:&lt;br /&gt;
        return &amp;quot;mouse up&amp;quot;;&lt;br /&gt;
      case SWT.MouseMove:&lt;br /&gt;
        return &amp;quot;mouse move&amp;quot;;&lt;br /&gt;
      case SWT.MouseEnter:&lt;br /&gt;
        return &amp;quot;mouse enter&amp;quot;;&lt;br /&gt;
      case SWT.MouseExit:&lt;br /&gt;
        return &amp;quot;mouse exit&amp;quot;;&lt;br /&gt;
      case SWT.MouseDoubleClick:&lt;br /&gt;
        return &amp;quot;mouse double click&amp;quot;;&lt;br /&gt;
      case SWT.Paint:&lt;br /&gt;
        return &amp;quot;paint&amp;quot;;&lt;br /&gt;
      case SWT.Move:&lt;br /&gt;
        return &amp;quot;move&amp;quot;;&lt;br /&gt;
      case SWT.Resize:&lt;br /&gt;
        return &amp;quot;resize&amp;quot;;&lt;br /&gt;
      case SWT.Dispose:&lt;br /&gt;
        return &amp;quot;dispose&amp;quot;;&lt;br /&gt;
      case SWT.Selection:&lt;br /&gt;
        return &amp;quot;selection&amp;quot;;&lt;br /&gt;
      case SWT.DefaultSelection:&lt;br /&gt;
        return &amp;quot;default selection&amp;quot;;&lt;br /&gt;
      case SWT.FocusIn:&lt;br /&gt;
        return &amp;quot;focus in&amp;quot;;&lt;br /&gt;
      case SWT.FocusOut:&lt;br /&gt;
        return &amp;quot;focus out&amp;quot;;&lt;br /&gt;
      case SWT.Expand:&lt;br /&gt;
        return &amp;quot;expand&amp;quot;;&lt;br /&gt;
      case SWT.Collapse:&lt;br /&gt;
        return &amp;quot;collapse&amp;quot;;&lt;br /&gt;
      case SWT.Iconify:&lt;br /&gt;
        return &amp;quot;iconify&amp;quot;;&lt;br /&gt;
      case SWT.Deiconify:&lt;br /&gt;
        return &amp;quot;deiconify&amp;quot;;&lt;br /&gt;
      case SWT.Close:&lt;br /&gt;
        return &amp;quot;close&amp;quot;;&lt;br /&gt;
      case SWT.Show:&lt;br /&gt;
        return &amp;quot;show&amp;quot;;&lt;br /&gt;
      case SWT.Hide:&lt;br /&gt;
        return &amp;quot;hide&amp;quot;;&lt;br /&gt;
      case SWT.Modify:&lt;br /&gt;
        return &amp;quot;modify&amp;quot;;&lt;br /&gt;
      case SWT.Verify:&lt;br /&gt;
        return &amp;quot;verify&amp;quot;;&lt;br /&gt;
      case SWT.Activate:&lt;br /&gt;
        return &amp;quot;activate&amp;quot;;&lt;br /&gt;
      case SWT.Deactivate:&lt;br /&gt;
        return &amp;quot;deactivate&amp;quot;;&lt;br /&gt;
      case SWT.Help:&lt;br /&gt;
        return &amp;quot;help&amp;quot;;&lt;br /&gt;
      case SWT.DragDetect:&lt;br /&gt;
        return &amp;quot;drag detect&amp;quot;;&lt;br /&gt;
      case SWT.Arm:&lt;br /&gt;
        return &amp;quot;arm&amp;quot;;&lt;br /&gt;
      case SWT.Traverse:&lt;br /&gt;
        return &amp;quot;traverse&amp;quot;;&lt;br /&gt;
      case SWT.MouseHover:&lt;br /&gt;
        return &amp;quot;mouse hover&amp;quot;;&lt;br /&gt;
      case SWT.HardKeyDown:&lt;br /&gt;
        return &amp;quot;hard key down&amp;quot;;&lt;br /&gt;
      case SWT.HardKeyUp:&lt;br /&gt;
        return &amp;quot;hard key up&amp;quot;;&lt;br /&gt;
      case SWT.MenuDetect:&lt;br /&gt;
        return &amp;quot;menu detect&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return &amp;quot;unkown ???&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>