Not sure what is going on here exactly. Their seems to be a change between how SWT Buttons are displayed on 'Windows 10' with the 'High Contrast White Theme' when moving between Java 7u51 and 7u55.
With 7u51 buttons have a 3d appearance and disabled buttons appears as greyed out. With 7u55 the buttons have a flatter appearance and disabled buttons just are outlined in red.
Here is a couple screenshots showing the issue. The show a window which displays the JVM version and 2 buttons one enabled and one disabled. There is a screenshot for when the app was run against 7u51 and 7u55 with everything else being kept the same.
This is the source code for above:
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class ButtonBugExample {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Button Bug Example");
shell.setLayout(new GridLayout(2,true));
Label label = new Label(shell, SWT.NONE);
label.setText("JVM Version:");
label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
Text textBox = new Text(shell, SWT.NONE);
textBox.setText(System.getProperty("java.version"));
textBox.setEditable(false);
textBox.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
Button enabledButton = new Button(shell,SWT.PUSH);
enabledButton.setText("Enabled");
enabledButton.setEnabled(true);
enabledButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
Button disabledButton = new Button(shell,SWT.PUSH);
disabledButton.setText("Disabled");
disabledButton.setEnabled(false);
disabledButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
}
Any idea what could be causing this? Is there anyway to work round it (i.e force SWT to use the 3d greyed out version)?
This is using the Oracle Java releases via http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html