Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home »  » 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: 5
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.

index.php/fa/27344/0/

index.php/fa/27345/0/

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


Current Time: Sun Dec 17 00:46:27 GMT 2017

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

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