X Tutup
Skip to content

Commit c1730d9

Browse files
author
jossonsmith
committed
Update Control Examples
1 parent cbb1c29 commit c1730d9

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,14 @@ void initResources() {
187187

188188
for (int i = 0; i < imageLocations.length; ++i) {
189189
InputStream sourceStream = clazz.getResourceAsStream(imageLocations[i]);
190-
images[i] = new Image(null, sourceStream);
191-
// ImageData source = new ImageData(sourceStream);
192-
// ImageData mask = source.getTransparencyMask();
193-
// images[i] = new Image(null, source, mask);
194-
// try {
195-
// sourceStream.close();
196-
// } catch (IOException e) {
197-
// e.printStackTrace();
198-
// }
199-
200-
//images[i] = new Image(null, "bin/org/eclipse/swt/examples/controlexample/" + imageLocations[i]);
190+
ImageData source = new ImageData(sourceStream);
191+
ImageData mask = source.getTransparencyMask();
192+
images[i] = new Image(null, source, mask);
193+
try {
194+
sourceStream.close();
195+
} catch (IOException e) {
196+
e.printStackTrace();
197+
}
201198
}
202199
}
203200
return;
@@ -216,20 +213,20 @@ void initResources() {
216213
*/
217214
public static void main(String[] args) {
218215
Display display = new Display();
219-
int style = SWT.SHELL_TRIM;
220216
int styleNone = SWT.NONE;
221-
// /**
222-
// * @j2sNative
223-
// * window.extraDisplay (display);
224-
// * style = styleNone;
225-
// */ {}
217+
int style = styleNone;
218+
style = SWT.SHELL_TRIM;
219+
/**
220+
* @j2sNative
221+
* style = styleNone;
222+
*/ {}
226223

227224
Shell shell = new Shell(display, style);
228225
shell.setLayout(new FillLayout());
229226
ControlExample instance = new ControlExample(shell);
230227
shell.setText(getResourceString("window.title"));
231-
setShellSize(display, shell);
232-
// shell.setMaximized(true);
228+
// setShellSize(display, shell);
229+
shell.setMaximized(true);
233230
shell.open();
234231
while (! shell.isDisposed()) {
235232
if (! display.readAndDispatch()) display.sleep();

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void createControlGroup () {
114114
* "Style" group, the "Other" group and the "Size" group.
115115
*/
116116
controlGroup = new Group (tabFolderPage, SWT.NONE);
117-
controlGroup.setLayout (new GridLayout (2, true));
117+
controlGroup.setLayout (new GridLayout (2, false));
118118
controlGroup.setLayoutData (new GridData(SWT.FILL, SWT.FILL, false, false));
119119
controlGroup.setText (ControlExample.getResourceString("Parameters"));
120120

0 commit comments

Comments
 (0)
X Tutup