[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] SWT widget borders not rendered correctly

I have a problem with SWT widgets not rendering as 3D on some WinXP machines. The same code will appear with 3D borders on some machines, while on others it will appear as a single pixel wide, blue line around the widget. All machines are running XP SP2. I am using SWT 3.2.2.

For instance, the following code looks different depending on the machine. What could be causing this?

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;

public class FlatBorderText {
 public static void main(String[] args) {
   Display display = new Display();
   Shell shell = new Shell(display, SWT.BORDER |SWT.CLOSE);
   shell.setSize(new Point(140, 100));
   shell.setLayout(null);
   Text textBox = new Text(shell, SWT.BORDER);
   textBox.setBounds(new Rectangle(10, 10, 115, 19));
   textBox.setText("Head for the border!");
   shell.open();
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch())
       display.sleep();
   }
   display.dispose();
 }
}