@@ -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 ();
0 commit comments