final WEmbeddedFrame frame = new WEmbeddedFrame (handle);
Constructor constructor = null; try { constructor = WEmbeddedFrame.class.getConstructor (new Class [] {int.class}); } catch (Exception e1) { try { constructor = WEmbeddedFrame.class.getConstructor (new Class [] {long.class}); } catch (Exception e2) { SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e2); } } WEmbeddedFrame value = null; try { value = (WEmbeddedFrame) constructor.newInstance (new Object [] {new Integer (handle)}); } catch (Exception e) { SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e); } final WEmbeddedFrame frame = value;
public static Panel new_Panel (final Composite parent) {	int handle = parent.handle;	final WEmbeddedFrame frame = new WEmbeddedFrame (handle);	Panel panel = new Panel ();	frame.add (panel);	parent.addListener (SWT.Activate, new Listener () {		public void handleEvent (Event e) {			frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));			frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_GAINED));		}	});	parent.addListener (SWT.Deactivate, new Listener () {		public void handleEvent (Event e) {			frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));			frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_LOST));		}	});	parent.addListener (SWT.Resize, new Listener () {		public void handleEvent (Event e) {			final Rectangle rect = parent.getClientArea ();			frame.getToolkit ().getSystemEventQueue ().invokeLater(new Runnable () {				public void run () {					frame.setSize (rect.width, rect.height);					frame.validate ();				}			});		}	});	parent.addListener (SWT.Dispose, new Listener () {		public void handleEvent (Event e) {			frame.dispose ();		}	});	return panel;}