[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] setTooltip throws ArrayIndexOutOfBoundsException

Hi,

While setting the tool tip text for a Control, an ArrayIndexOutOfBoundsException exception is thrown if the text ends with an ampersand (&) character.

The following snippet illustrates the problem with a Shell.

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class TestToolTip {

	public static void main(String[] args) {

		Display display = new Display();
		Shell shell = new Shell(display);

		shell.setToolTipText("test &");

		shell.setSize(600, 600);
		shell.layout();
		shell.open();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose ();
	}
}

Thanks for your help,
Helene