Mega Code Archive

 
Categories / Java Tutorial / SWT
 

Get color for the given constant

import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Display; public class MainClass {   static Display display = new Display();   public static void main(String[] args) {     Color col = display.getSystemColor(SWT.COLOR_BLUE);   } } The returned color should not be freed because it was allocated and managed by the system.