public static void main(java.lang.String[] args) { org.eclipse.swt.widgets.Display display = new org.eclipse.swt.widgets.Display(); org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(display); shell.setLayout(new org.eclipse.swt.layout.FillLayout()); shell.setText(getResourceString("window.title")); java.io.InputStream stream = (org.eclipse.swt.examples.browserexample.BrowserExample.class) .getResourceAsStream(iconLocation); org.eclipse.swt.graphics.Image icon = new org.eclipse.swt.graphics.Image(display, stream); shell.setImage(icon); try { stream.close(); } catch (java.io.IOException e) { e.printStackTrace(); } org.eclipse.swt.examples.browserexample.BrowserExample app = new org.eclipse.swt.examples.browserexample.BrowserExample(shell, true); app.setShellDecoration(icon, true); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } icon.dispose(); app.dispose(); display.dispose(); }
void freeResources() { if (images != null) { for (int i = 0; i < images.length; ++i) { final org.eclipse.swt.graphics.Image image = images[i]; if (image != null) { image.dispose(); } } images = null; } }