I am looking for a way to draw dynamic diagrams in SWT. I have found a very power Java library called JFreeChart. Unfortunately it support Swing better than SWT. Therefore I need a way to embed Swing into my SWT GUI.
I have discovered that SWT provides an very easy way to do so.For many SWT components, they have a attribute called SWT.EMBEDDED. By adding this attribute, the component knows that another application is plugged in.
Here is an example of this function.
Display display = new display();
Shell shell = new shell(display, SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(shell);
frame.add(new JLabel("This is a Java Swing Label"));