diff options
Diffstat (limited to 'examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java')
-rw-r--r-- | examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java index 4e05ace5ea..4ff5ef3c64 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet100.java @@ -28,14 +28,15 @@ public class Snippet100 { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); + shell.setText("Snippet 100"); shell.setBounds(10, 10, 200, 200); Text text = new Text(shell, SWT.MULTI); Rectangle clientArea = shell.getClientArea(); text.setBounds(clientArea.x + 10, clientArea.y + 10, 150, 150); Font initialFont = text.getFont(); FontData[] fontData = initialFont.getFontData(); - for (int i = 0; i < fontData.length; i++) { - fontData[i].setHeight(24); + for (FontData element : fontData) { + element.setHeight(24); } Font newFont = new Font(display, fontData); text.setFont(newFont); |