Composite composite = new Composite(parent, SWT.NONE); Font font = composite.getFont(); // get the font used by the composite
Composite composite = new Composite(parent, SWT.NONE); FontData[] fontData = composite.getFont().getFontData(); for (FontData data : fontData) { System.out.println(data.getName()); // print the name of the font used by the composite }This example is similar to the first example, but instead of simply retrieving the font, it gets the data for the font and prints out its name. `org.eclipse.swt.widgets.Composite` is part of the Eclipse SWT library.