<?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_Tutorial%2FSWT%2FSWT_Cursor</id>
		<title>Java Tutorial/SWT/SWT Cursor - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FSWT%2FSWT_Cursor"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Cursor&amp;action=history"/>
		<updated>2026-04-21T15:32:39Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Cursor&amp;diff=3123&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Cursor&amp;diff=3123&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;&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;Версия 17:44, 31 мая 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>
			</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Cursor&amp;diff=3124&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/SWT_Cursor&amp;diff=3124&amp;oldid=prev"/>
				<updated>2010-05-31T15:21:00Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Create a color cursor from a source and a mask ==&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) 2000, 2004 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/*&lt;br /&gt;
 * Cursor example snippet: create a color cursor from a source and a mask&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 * &lt;br /&gt;
 * @since 3.0&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;
import org.eclipse.swt.events.PaintListener;&lt;br /&gt;
import org.eclipse.swt.graphics.Color;&lt;br /&gt;
import org.eclipse.swt.graphics.Cursor;&lt;br /&gt;
import org.eclipse.swt.graphics.GC;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.graphics.ImageData;&lt;br /&gt;
import org.eclipse.swt.graphics.PaletteData;&lt;br /&gt;
import org.eclipse.swt.graphics.RGB;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class CursorFromSourceMask {&lt;br /&gt;
  static byte[] srcData = { (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0x00, (byte) 0x00,&lt;br /&gt;
      (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0x10, (byte) 0x00, (byte) 0x01,&lt;br /&gt;
      (byte) 0x10, (byte) 0x00, (byte) 0x01, (byte) 0x11, (byte) 0x11, (byte) 0x00, (byte) 0x22,&lt;br /&gt;
      (byte) 0x01, (byte) 0x10, (byte) 0x33, (byte) 0x00, (byte) 0x11, (byte) 0x10, (byte) 0x02,&lt;br /&gt;
      (byte) 0x22, (byte) 0x01, (byte) 0x10, (byte) 0x33, (byte) 0x30, (byte) 0x01, (byte) 0x10,&lt;br /&gt;
      (byte) 0x22, (byte) 0x22, (byte) 0x01, (byte) 0x10, (byte) 0x33, (byte) 0x33, (byte) 0x01,&lt;br /&gt;
      (byte) 0x10, (byte) 0x22, (byte) 0x22, (byte) 0x01, (byte) 0x10, (byte) 0x33, (byte) 0x33,&lt;br /&gt;
      (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,&lt;br /&gt;
      (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x11, (byte) 0x11, (byte) 0x01, (byte) 0x10,&lt;br /&gt;
      (byte) 0x11, (byte) 0x11, (byte) 0x10, (byte) 0x01, (byte) 0x11, (byte) 0x11, (byte) 0x01,&lt;br /&gt;
      (byte) 0x10, (byte) 0x11, (byte) 0x11, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00,&lt;br /&gt;
      (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x44,&lt;br /&gt;
      (byte) 0x44, (byte) 0x01, (byte) 0x10, (byte) 0x55, (byte) 0x55, (byte) 0x01, (byte) 0x10,&lt;br /&gt;
      (byte) 0x44, (byte) 0x44, (byte) 0x01, (byte) 0x10, (byte) 0x55, (byte) 0x55, (byte) 0x01,&lt;br /&gt;
      (byte) 0x10, (byte) 0x04, (byte) 0x44, (byte) 0x01, (byte) 0x10, (byte) 0x55, (byte) 0x50,&lt;br /&gt;
      (byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x44, (byte) 0x01, (byte) 0x10, (byte) 0x55,&lt;br /&gt;
      (byte) 0x00, (byte) 0x11, (byte) 0x11, (byte) 0x10, (byte) 0x00, (byte) 0x01, (byte) 0x10,&lt;br /&gt;
      (byte) 0x00, (byte) 0x01, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0x00,&lt;br /&gt;
      (byte) 0x00, (byte) 0x11, (byte) 0x11, (byte) 0x11, };&lt;br /&gt;
  static byte[] mskData = { (byte) 0x03, (byte) 0xc0, (byte) 0x1f, (byte) 0xf8, (byte) 0x3f,&lt;br /&gt;
      (byte) 0xfc, (byte) 0x7f, (byte) 0xfe, (byte) 0x7f, (byte) 0xfe, (byte) 0x7f, (byte) 0xfe,&lt;br /&gt;
      (byte) 0xff, (byte) 0xff, (byte) 0xfe, (byte) 0x7f, (byte) 0xfe, (byte) 0x7f, (byte) 0xff,&lt;br /&gt;
      (byte) 0xff, (byte) 0x7f, (byte) 0xfe, (byte) 0x7f, (byte) 0xfe, (byte) 0x7f, (byte) 0xfe,&lt;br /&gt;
      (byte) 0x3f, (byte) 0xfc, (byte) 0x1f, (byte) 0xf8, (byte) 0x03, (byte) 0xc0 };&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Color white = display.getSystemColor(SWT.COLOR_WHITE);&lt;br /&gt;
    Color black = display.getSystemColor(SWT.COLOR_BLACK);&lt;br /&gt;
    Color yellow = display.getSystemColor(SWT.COLOR_YELLOW);&lt;br /&gt;
    Color red = display.getSystemColor(SWT.COLOR_RED);&lt;br /&gt;
    Color green = display.getSystemColor(SWT.COLOR_GREEN);&lt;br /&gt;
    Color blue = display.getSystemColor(SWT.COLOR_BLUE);&lt;br /&gt;
    // Create a source ImageData of depth 4&lt;br /&gt;
    PaletteData palette = new PaletteData(new RGB[] { black.getRGB(), white.getRGB(),&lt;br /&gt;
        yellow.getRGB(), red.getRGB(), blue.getRGB(), green.getRGB() });&lt;br /&gt;
    ImageData sourceData = new ImageData(16, 16, 4, palette, 1, srcData);&lt;br /&gt;
    // Create a mask ImageData of depth 1 (monochrome)&lt;br /&gt;
    palette = new PaletteData(new RGB[] { black.getRGB(), white.getRGB(), });&lt;br /&gt;
    ImageData maskData = new ImageData(16, 16, 1, palette, 1, mskData);&lt;br /&gt;
    // Set mask&lt;br /&gt;
    sourceData.maskData = maskData.data;&lt;br /&gt;
    sourceData.maskPad = maskData.scanlinePad;&lt;br /&gt;
    // Create cursor&lt;br /&gt;
    Cursor cursor = new Cursor(display, sourceData, 10, 10);&lt;br /&gt;
    // Remove mask to draw them separately just to show what they look like&lt;br /&gt;
    sourceData.maskData = null;&lt;br /&gt;
    sourceData.maskPad = -1;&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    final Image source = new Image(display, sourceData);&lt;br /&gt;
    final Image mask = new Image(display, maskData);&lt;br /&gt;
    shell.addPaintListener(new PaintListener() {&lt;br /&gt;
      public void paintControl(PaintEvent e) {&lt;br /&gt;
        GC gc = e.gc;&lt;br /&gt;
        int x = 10, y = 10;&lt;br /&gt;
        String stringSource = &amp;quot;source: &amp;quot;;&lt;br /&gt;
        String stringMask = &amp;quot;mask: &amp;quot;;&lt;br /&gt;
        gc.drawString(stringSource, x, y);&lt;br /&gt;
        gc.drawString(stringMask, x, y + 30);&lt;br /&gt;
        x += Math.max(gc.stringExtent(stringSource).x, gc.stringExtent(stringMask).x);&lt;br /&gt;
        gc.drawImage(source, x, y);&lt;br /&gt;
        gc.drawImage(mask, x, y + 30);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    shell.setSize(150, 150);&lt;br /&gt;
    shell.open();&lt;br /&gt;
    shell.setCursor(cursor);&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    cursor.dispose();&lt;br /&gt;
    source.dispose();&lt;br /&gt;
    mask.dispose();&lt;br /&gt;
    display.dispose();&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;
==  Create a cursor from a source and a mask ==&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) 2000, 2004 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/*&lt;br /&gt;
 * Cursor example snippet: create a cursor from a source and a mask&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;
import org.eclipse.swt.events.PaintListener;&lt;br /&gt;
import org.eclipse.swt.graphics.Color;&lt;br /&gt;
import org.eclipse.swt.graphics.Cursor;&lt;br /&gt;
import org.eclipse.swt.graphics.GC;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.graphics.ImageData;&lt;br /&gt;
import org.eclipse.swt.graphics.PaletteData;&lt;br /&gt;
import org.eclipse.swt.graphics.RGB;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class CursorFromMask {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Color white = display.getSystemColor(SWT.COLOR_WHITE);&lt;br /&gt;
    Color black = display.getSystemColor(SWT.COLOR_BLACK);&lt;br /&gt;
    // Create a source ImageData of depth 1 (monochrome)&lt;br /&gt;
    PaletteData palette = new PaletteData(new RGB[] { white.getRGB(), black.getRGB(), });&lt;br /&gt;
    ImageData sourceData = new ImageData(20, 20, 1, palette);&lt;br /&gt;
    for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;
      for (int j = 0; j &amp;lt; 20; j++) {&lt;br /&gt;
        sourceData.setPixel(i, j, 1);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    // Create a mask ImageData of depth 1 (monochrome)&lt;br /&gt;
    palette = new PaletteData(new RGB[] { white.getRGB(), black.getRGB(), });&lt;br /&gt;
    ImageData maskData = new ImageData(20, 20, 1, palette);&lt;br /&gt;
    for (int i = 0; i &amp;lt; 20; i++) {&lt;br /&gt;
      for (int j = 0; j &amp;lt; 10; j++) {&lt;br /&gt;
        maskData.setPixel(i, j, 1);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    // Create cursor&lt;br /&gt;
    Cursor cursor = new Cursor(display, sourceData, maskData, 10, 10);&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    final Image source = new Image(display, sourceData);&lt;br /&gt;
    final Image mask = new Image(display, maskData);&lt;br /&gt;
    // Draw source and mask just to show what they look like&lt;br /&gt;
    shell.addPaintListener(new PaintListener() {&lt;br /&gt;
      public void paintControl(PaintEvent e) {&lt;br /&gt;
        GC gc = e.gc;&lt;br /&gt;
        gc.drawString(&amp;quot;source: &amp;quot;, 10, 10);&lt;br /&gt;
        gc.drawImage(source, 0, 0, 20, 20, 60, 10, 20, 20);&lt;br /&gt;
        gc.drawString(&amp;quot;mask: &amp;quot;, 10, 40);&lt;br /&gt;
        gc.drawImage(mask, 0, 0, 20, 20, 60, 40, 20, 20);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    shell.setSize(150, 150);&lt;br /&gt;
    shell.open();&lt;br /&gt;
    shell.setCursor(cursor);&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    cursor.dispose();&lt;br /&gt;
    source.dispose();&lt;br /&gt;
    mask.dispose();&lt;br /&gt;
    display.dispose();&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;
==  Create Cursor from an Image ==&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.graphics.Cursor;&lt;br /&gt;
import org.eclipse.swt.graphics.Image;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class CursorImageCreate {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    final Display display = new Display();&lt;br /&gt;
    final Shell shell = new Shell(display);&lt;br /&gt;
    shell.setSize(150, 150);&lt;br /&gt;
    &lt;br /&gt;
    Cursor cursor = new Cursor(display, new Image(display,&amp;quot;yourFile.gif&amp;quot;).getImageData(), 0, 0);&lt;br /&gt;
    shell.setCursor(cursor);&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;
    cursor.dispose();&lt;br /&gt;
    display.dispose();&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;
==  Set Cursor to Control ==&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.graphics.Cursor;&lt;br /&gt;
import org.eclipse.swt.widgets.Button;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class CursorSetControl {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    &lt;br /&gt;
    Cursor cursor = new Cursor(display, SWT.CURSOR_HAND);&lt;br /&gt;
    &lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.open();&lt;br /&gt;
    final Button b = new Button(shell, 0);&lt;br /&gt;
    b.setBounds(10, 10, 200, 200);&lt;br /&gt;
    b.setCursor(cursor);&lt;br /&gt;
    &lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    cursor.dispose();&lt;br /&gt;
    display.dispose();&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;
==  Use transparent image to hide Cursor ==&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) 2000, 2006 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/* &lt;br /&gt;
 * Cursor snippet: Hide the Cursor over a control.&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;
import org.eclipse.swt.events.PaintListener;&lt;br /&gt;
import org.eclipse.swt.graphics.Color;&lt;br /&gt;
import org.eclipse.swt.graphics.Cursor;&lt;br /&gt;
import org.eclipse.swt.graphics.ImageData;&lt;br /&gt;
import org.eclipse.swt.graphics.PaletteData;&lt;br /&gt;
import org.eclipse.swt.graphics.RGB;&lt;br /&gt;
import org.eclipse.swt.widgets.Canvas;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class CursorHideControl {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Display display = new Display();&lt;br /&gt;
    Shell shell = new Shell(display);&lt;br /&gt;
    shell.setBounds(10, 10, 200, 200);&lt;br /&gt;
    Canvas canvas = new Canvas(shell, SWT.BORDER);&lt;br /&gt;
    canvas.setBounds(10, 50, 150, 100);&lt;br /&gt;
    canvas.addPaintListener(new PaintListener() {&lt;br /&gt;
      public void paintControl(PaintEvent e) {&lt;br /&gt;
        e.gc.drawString(&amp;quot;hide Cursor here&amp;quot;, 10, 10);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    // create a cursor with a transparent image&lt;br /&gt;
    Color white = display.getSystemColor(SWT.COLOR_WHITE);&lt;br /&gt;
    Color black = display.getSystemColor(SWT.COLOR_BLACK);&lt;br /&gt;
    PaletteData palette = new PaletteData(new RGB[] { white.getRGB(), black.getRGB() });&lt;br /&gt;
    ImageData sourceData = new ImageData(16, 16, 1, palette);&lt;br /&gt;
    sourceData.transparentPixel = 0;&lt;br /&gt;
    Cursor cursor = new Cursor(display, sourceData, 0, 0);&lt;br /&gt;
    shell.open();&lt;br /&gt;
    canvas.setCursor(cursor);&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    cursor.dispose();&lt;br /&gt;
    display.dispose();&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>
		<author><name>Admin</name></author>	</entry>

	</feed>