List of usage examples for javax.swing JFrame add
public Component add(Component comp)
From source file:Main.java
public static void main(String[] args) { JFrame f = new JFrame(); final JTabbedPane jtp = new JTabbedPane(); jtp.add("One", createPanel()); jtp.add("Two", createPanel()); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(jtp); f.pack();//w w w. java 2s .c o m f.setVisible(true); }