Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Issue with how SWT Buttons appear on Windows 10(There is a change between how SWT Buttons are displayed between Java 7u51 and 7u55 on windows 10 when using High Contrast White theme )
Issue with how SWT Buttons appear on Windows 10 [message #1745476] Tue, 11 October 2016 11:21
Alex Clayton is currently offline Alex ClaytonFriend
Messages: 8
Registered: February 2015
Junior Member
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.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
		Button enabledButton = new Button(shell,SWT.PUSH);
		enabledButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
		Button disabledButton = new Button(shell,SWT.PUSH);
		disabledButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));

		while (!shell.isDisposed()) {
		        if (!display.readAndDispatch())




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
Previous Topic:Customize treeview expander for HiDpi
Next Topic:Putting Buttons into Table Headline
Goto Forum:

Current Time: Tue Mar 31 03:20:08 GMT 2020

Powered by FUDForum. Page generated in 0.01401 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top