Swing vs SWT issues [message #462753] |
Tue, 18 October 2005 19:41  |
Eclipse User |
|
|
|
Hi All,
I basically have two questions regaring SWT and SWING integration
if I can get the answers for the following that will be great.
1)
I allready have a application(which extends JFrame as follows
public class ExistingAPP extends JFrame implements WindowListener
and then when I try to use the java.awt.Frame xxx=
SWT_AWT.new_Frame(xxxxx);
it gives the following error
Exception in thread "main" java.lang.IllegalArgumentException: adding a
window to a container
The code sample I used is
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("SWT Swing Example");
Composite locationComp = new Composite(shell, SWT.EMBEDDED);
final Composite comp = new Composite(shell, SWT.NONE);
Composite tableComp = new Composite(comp, SWT.EMBEDDED);
java.awt.Frame fileTableFrame = SWT_AWT.new_Frame(tableComp);
java.awt.Panel panel = new java.awt.Panel(new java.awt.BorderLayout());
fileTableFrame.add(panel);
LogSvr.logDebug("Going to construct JFram Appliction");
panel.add(new JFrameApplication());
shell.open();
while(!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
2) The second question is
In a primitive SWT application the above stated JFrameApplication
starts though it gives the above error, but in a wizard based SWT
application it gives the following error and doesnt not start the
application
Unhandled event loop exception
Reason:
com/xxxx/xxxx/......
What is meant by this.
Waiting for a early reply
Thanks,
Peter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Swing vs SWT issues [message #462910 is a reply to message #462909] |
Thu, 20 October 2005 21:30  |
Eclipse User |
|
|
|
Peter wrote:
> I am running like that,
>
> What is the defaul location to put the thirdparty jars
i make separate plugin and lib subdirectory, but it isn't important
you have to add it in runtime and export packages what you want use in
another plugin (i export all ,but it have to export every packages in new
MANIFEST.MF; before it exists *)
you export it on old way (old plugin.xml) and you check is it in runtime tab
is it fine when you use this packages in another plugins (don't add packages
in build path properties - add only dependency for jars plugins - then you
can environment like runtime)
Peco
|
|
|
Powered by
FUDForum. Page generated in 0.12473 seconds