Thanks! Steve.
Actually, The code below works:
-------------------------
Frame[] frames = Frame.getFrames();
System.out.println(Arrays.asList(frames));
-------------------------
It seems the SWT widgets and Swing/AWT components live in a total isolated environment. We can't access Swing/AWT through SWT API.
Cheers,
John (Zuokun) Zhang
Steve Northover <Steve_Northover@xxxxxxxxxx> wrote:
How about looking for instanceof sun.awt.EmbeddedFrame?
zuo kun <zuokunzhang@xxxxxxxxx> Sent by:
platform-swt-dev-bounces@xxxxxxxxxxx 12/08/2005 06:37 PM Please respond to "Eclipse Platform SWT component developers list." | | To | platform-swt-dev@xxxxxxxxxxx | cc |
| Subject | [platform-swt-dev] How to access Swing components in a SWT EMBEDDED composite |
|
Hi,
To get a list of all components in a Swing Component
or Eclipse Composite, we can use code like below to do
the job.
public void getAllComponents(Component c, Collection
collection) {
collection.add(c);
if (c instanceof Container) {
Component[] kids = ((Container)c).getComponents();
for(int i=0; i<kids.length; i++)
getAllComponents(kids[i], collection);
}
}
but if I embedd some Swing component inside SWT
composite like the
Snippet135(http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java?rev=HEAD&content-type=text/vnd.viewcvs-markup)
on Eclipse Swt page, how can I list all the AWT/Swing
objects?
Thanks in advance!
John (Zuokun)
Zhang
2005-12-08
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev