GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Wednesday, December 22, 2010

Swing JTabbedPane

Here's a code on how to show about JTabbedPane: Layout for tabbed pane is BorderLayout by default.

import javax.swing.*;

public class Main{

    public static void main(String[] args){

        JFrame frame = new JFrame("Tab Pane Application");

        JTabbedPane tabPane = new JTabbedPane();

        tabPane.addTab("General", new JButton("Exit"));
        tabPane.addTab("Configuration");
        tabPane.addTab("Advance");

        frame.add(tabPane);
        frame.setSize(400, 300);
        frame.setLocation(200, 100);
        frame.setDefaultCloseOporation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);

    }
}
Share/Bookmark

No comments:

Post a Comment