Viewer viewer = new Viewer(rootContainer, null);
frame.add(rootContainer, BorderLayout.CENTER);
rootContainer = Display Component
frame = Your applications GUI
For more information read the tutorial