Example usage for javax.swing JFrame add

List of usage examples for javax.swing JFrame add

Introduction

In this page you can find the example usage for javax.swing JFrame add.

Prototype

public Component add(Component comp) 

Source Link

Document

Appends the specified component to the end of this container.

Usage

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);
}