import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import javax.swing.*;


public class Main {

    public static void main(String[] args) {
        Display display = new Display ();
        Shell shell = new Shell(display);
        Text helloWorldTest = new Text(shell, SWT.NONE);
        helloWorldTest.setText("Hello World SWT");
        helloWorldTest.pack();
        shell.setBounds(300,100,200,100);
        shell.open();

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                JTextField text = new JTextField("Hello World AWT");
                frame.setBounds(100,100,200,100);
                frame.add(text);
                frame.setVisible(true);
            }
        });

        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) display.sleep();
        }
        display.dispose();
    }
}
