- 85 名前:デフォルトの名無しさん mailto:sage [2007/01/25(木) 18:29:24 ]
- >>24
import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class TwoWindow { public static void main(String[] args) { Display display = new Display(); String[] images = {"image1.jpg", "image2.jpg"}; Shell[] shells = new Shell[images.length]; for (int i = 0; i < images.length; i++) { shells[i] = new Shell(display); new Label(shells[i], SWT.NULL).setImage(new Image(display, images[i])); shells[i].setLayout(new FillLayout()); shells[i].pack(); shells[i].open(); } while (! isAllDisposed(shells)) if (! display.readAndDispatch()) display.sleep(); display.dispose(); } private static boolean isAllDisposed(Shell... shells) { for (Shell shell : shells) if (! shell.isDisposed()) return false; return true; } }
|

|