0

I have a simple JFrame and a JPanel inside it.

public class TestPanel extends JFrame {

    private JPanel contentPane;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    TestPanel frame = new TestPanel();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the frame.
     */
    public TestPanel() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 450, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(new BorderLayout(0, 0));

        JPanel panel = new JPanel();
        contentPane.add(panel, BorderLayout.CENTER);
    }

}

And I have an SWT widget (Nebula Gantt Chart). --> http://hexapixel.com/software/ganttwidget

I would like to add this SWT widget to the JPanel, actually embed it.

What are the possible ways to do it? Thank you for help! :-)

Genesist
  • 141
  • 2
  • 3
  • 7
  • Are you sure you want to go down this road? Be prepared to face a lot of problems when using multiple GUI toolkits. Is it not possible for you to decide on one of them? – Baz Oct 16 '13 at 12:27
  • Basically the main program's GUI is written in SWING. If the SWT --> Swing embedding cause a lot of problem I'll try to find other Gantt Chart tool. But still the Nebula seems the best solution. :-/ – Genesist Oct 16 '13 at 12:35
  • And I guess switching to SWT completely isn't an option? – Baz Oct 16 '13 at 13:10
  • Unfortunately it is not an option. – Genesist Oct 16 '13 at 13:47
  • 1
    Ok, then at least have a look at the Swing alternatives (some can be found [here](http://stackoverflow.com/questions/12992340/java-swing-open-source-gantt-chart-library)) before trying to use Swing and SWT. – Baz Oct 16 '13 at 13:48

0 Answers0