Bug 168314 Snippet 252 a bit confusing
Snippet 252 (the one posted on the N&N for M4) sets a line width of 1/2. Since these are both integers, it does the division first and then the cast. This sets the line style to 0.0. I assume (since the N&N says something about fractional line width) you meant 1/2f.
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet252.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 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;
/*
 * LineAttributes example snippet: draw 2 polylines with different line attributes.
 *
 * For a list of all SWT example snippets see
 * http://www.eclipse.org/swt/snippets/
 */
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
public class Snippet252 {