How to add a Shell to a jPanel. I created a shell with components and now I want to add it to a jPanel called jPanel1. How can I do this?
private Shell sShell = null;
sShell = new Shell();
How to add a Shell to a jPanel. I created a shell with components and now I want to add it to a jPanel called jPanel1. How can I do this?
private Shell sShell = null;
sShell = new Shell();
In the Eclipse Standard Widget Toolkit (SWT) a Shell (org.eclipse.swt.widgets.Shell
) represents a window, whereas a JPanel (javax.swing.JPanel
) represents only a container in the Java Swing GUI widget toolkit.
Therefore it is not possible to add a org.eclipse.swt.widgets.Shell
to a javax.swing.JPanel
.
It is not recommended to mix different GUI widget toolkits. There are only rare cases where this make sense (e. g. using a SWT browser widget in Swing). If you want to use Swing, see e. g. Lesson: Getting Started with Swing, if you want to use SWT, these SWT snippets might be helpful.