Bug 136673 Snippet133 - NullPointerException
Version: 3.2.0 Build id: I20060412-0847- Run Snippet133 ps. Couldn't reproduce the bug in windows, only motif. - Add some text - Go to File -> Change Foreground, pick any color - Go to File -> Change Background, pick any color. The following exception appears: Exception in thread "main" java.lang.NullPointerException at org.eclipse.swt.widgets.Display.showToolTip(Display.java:3342) at org.eclipse.swt.widgets.Control.hoverProc(Control.java:1129) at org.eclipse.swt.widgets.Control.hoverProc(Control.java:1126) at org.eclipse.swt.widgets.Display.mouseHoverProc(Display.java:2583) at org.eclipse.swt.internal.motif.OS._XtAppProcessEvent(Native Method) at org.eclipse.swt.internal.motif.OS.XtAppProcessEvent(OS.java:3737) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2735) at org.eclipse.swt.widgets.ColorDialog.openModal(ColorDialog.java:421) at org.eclipse.swt.widgets.ColorDialog.open(ColorDialog.java:358) at org.eclipse.swt.snippets.Snippet133.menuBackgroundColor(Snippet133.java:189) at org.eclipse.swt.snippets.Snippet133$4.widgetSelected(Snippet133.java:98) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:775) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3059) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2748) at org.eclipse.swt.snippets.Snippet133.open(Snippet133.java:121) at org.eclipse.swt.snippets.Snippet133.main(Snippet133.java:49)
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet133.java
StringBuffer wordBuffer;
	public static void main(String[] args) {
		new Snippet133().open();
	}
	
	void open() {
		display = new Display();
		font = new Font(display, "Courier", 10, SWT.NORMAL);
		foregroundColor = display.getSystemColor(SWT.COLOR_BLACK);
		backgroundColor = display.getSystemColor(SWT.COLOR_WHITE);
		shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setText("Print Text");
		shell.setMaximized(true);
		text = new Text(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
		text.setFont(font);
		text.setForeground(foregroundColor);
		text.setBackground(backgroundColor);
		
		Menu menuBar = new Menu(shell, SWT.BAR);
		shell.setMenuBar(menuBar);
		MenuItem item = new MenuItem(menuBar, SWT.CASCADE);
		item.setText("&File");
		Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
		item.setMenu(fileMenu);
		item = new MenuItem(fileMenu, SWT.PUSH);
		item.setText("&Open...");
		item.setAccelerator(SWT.CTRL + 'O');
		item.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent event) {