Example usage for javax.swing JTabbedPane JTabbedPane

List of usage examples for javax.swing JTabbedPane JTabbedPane

Introduction

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

Prototype

public JTabbedPane() 

Source Link

Document

Creates an empty TabbedPane with a default tab placement of JTabbedPane.TOP.

Usage

From source file:gtu._work.ui.RenameUI.java

private void initGUI() {
    try {// w  w w .  j av  a 2 s  .c  o  m
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("\u9078\u64c7\u76ee\u9304");
                }
                {
                    srcDirText = new JTextField();
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(srcDirText, true);
                    jPanel1.add(srcDirText);
                    srcDirText.setPreferredSize(new java.awt.Dimension(470, 22));
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("\u6a94\u540dRegex");
                    jLabel2.setPreferredSize(new java.awt.Dimension(68, 15));
                }
                {
                    findFileRegexText = new JTextField();
                    jPanel1.add(findFileRegexText);
                    findFileRegexText.setPreferredSize(new java.awt.Dimension(446, 22));
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("\u4fee\u6539\u5f8c\u6a94\u540d");
                    jLabel3.setPreferredSize(new java.awt.Dimension(68, 15));
                }
                {
                    renameRegexText = new JTextField();
                    jPanel1.add(renameRegexText);
                    renameRegexText.setPreferredSize(new java.awt.Dimension(446, 22));
                }
                {
                    scanBtn = new JButton();
                    jPanel1.add(scanBtn);
                    scanBtn.setText("\u6383\u63cf\u76ee\u9304");
                    scanBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            scanBtnActionPerformed();
                        }
                    });
                }
                {
                    usePatternNewNameBtn = new JButton();
                    jPanel1.add(usePatternNewNameBtn);
                    usePatternNewNameBtn.setText("\u5957\u7528\u6a94\u540d");
                    usePatternNewNameBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            usePatternNewNameBtnActionPerformed();
                        }
                    });
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u4ee5\u8868\u683c\u8a2d\u5b9a\u66f4\u6b63");
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed();
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(552, 338));
                    {
                        renameTable = new JTable();
                        jScrollPane1.setViewportView(renameTable);
                        JTableUtil.defaultSetting(renameTable);
                        renameTable.setModel(createNewModel());
                    }
                }
            }
        }
        pack();
        this.setSize(565, 392);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:org.encog.workbench.tabs.weights.AnalyzeWeightsTab.java

public AnalyzeWeightsTab(EncogPersistedObject encogObject) {
    super(encogObject);

    this.network = (BasicNetwork) encogObject;
    this.analyze = new AnalyzeNetwork(this.network);

    this.setLayout(new BorderLayout());

    JPanel buttonPanel = new JPanel();
    add(buttonPanel, BorderLayout.SOUTH);

    this.buttonClose = new JButton("Close");
    buttonPanel.add(this.buttonClose);
    this.buttonClose.addActionListener(this);

    this.weightInfo = new WeightInfo(this);
    this.add(this.weightInfo, BorderLayout.NORTH);

    ///*from   www . j a  v  a 2 s . c o m*/
    createAllDataset();
    ChartPanel allChart = new ChartPanel(createChart(this.dataAll));
    ChartPanel weightChart = new ChartPanel(createChart(this.dataWeights));
    ChartPanel thresholdChart = new ChartPanel(createChart(this.dataThresholds));

    this.tabs = new JTabbedPane();
    this.add(tabs, BorderLayout.CENTER);
    this.tabs.addTab("Weights & Thresholds", allChart);
    this.tabs.addTab("Thresholds", weightChart);
    this.tabs.addTab("Weights", thresholdChart);

}

From source file:jchrest.gui.VisualSearchPane.java

public VisualSearchPane(Chrest model, Scenes scenes) {
    super();/* w  ww  .j ava2  s. com*/

    _model = model;
    _scenes = scenes;
    //TODO: fix this when perceiver functionality working correctly.
    //_model.getPerceiver().setScene (_scenes.get (0));
    _model.setClocks(0);
    _sceneDisplay = new SceneDisplay(_scenes.get(0));
    _domainSelector = new JComboBox(new String[] { "Generic", "Chess" });
    _domainSelector.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            int index = _domainSelector.getSelectedIndex();
            if (index == 0) {
                _model.setDomain(new GenericDomain(_model, null, 3));
            } else { // if (index == 1) 
                //TODO: fix this when perceiver functionality working correctly.
                //_model.setDomain (new ChessDomain (_model));
            }
        }
    });

    JTabbedPane jtb = new JTabbedPane();
    jtb.addTab("Train", trainPanel());
    jtb.addTab("Recall", recallPanel());
    jtb.addTab("Log", logPanel());
    jtb.addTab("Analyse", analysePanel());

    setLayout(new BorderLayout());
    add(jtb);
}

From source file:gtu._work.ui.RegexTestUI.java

private void initGUI() {
    try {/*from  w w w . j a  v  a 2 s  . co  m*/
        DocumentListener docListener = JCommonUtil.getDocumentListener(new HandleDocumentEvent() {
            public void process(DocumentEvent event) {
                jText1OrJArea1Change(event);
            }
        });

        BorderLayout thisLayout = new BorderLayout();
        getContentPane().setLayout(thisLayout);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        {
            jTabbedPane1 = new JTabbedPane();
            jTabbedPane1.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    jText1OrJArea1Change(null);
                }
            });
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("src text", null, jPanel1, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    {
                        srcArea = new JTextArea();
                        jScrollPane1.setViewportView(srcArea);
                        srcArea.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        JCommonUtil.setFont(srcArea);
                        srcArea.addKeyListener(new KeyAdapter() {
                            @Override
                            public void keyPressed(KeyEvent e) {
                                jText1OrJArea1Change(null);
                            }
                        });
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("group", null, jPanel2, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel2.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(398, 234));
                    {
                        ListModel groupListModel = new DefaultComboBoxModel();
                        groupList = new JList();
                        jScrollPane2.setViewportView(groupList);
                        groupList.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        groupList.setModel(groupListModel);
                        JCommonUtil.setFont(groupList);
                    }
                }
                {
                    regexText0 = new JTextField();
                    jPanel2.add(regexText0, BorderLayout.NORTH);
                    regexText0.setBorder(
                            BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                    JCommonUtil.setFont(regexText0);
                    regexText0.getDocument().addDocumentListener(docListener);
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("scanner", null, jPanel3, null);
                {
                    jScrollPane3 = new JScrollPane();
                    jPanel3.add(jScrollPane3, BorderLayout.CENTER);
                    {
                        ListModel scannerListModel = new DefaultComboBoxModel();
                        scannerList = new JList();
                        jScrollPane3.setViewportView(scannerList);
                        scannerList.setBorder(
                                BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                        scannerList.setModel(scannerListModel);
                        JCommonUtil.setFont(scannerList);
                    }
                }
                {
                    regexText = new JTextField();
                    jPanel3.add(regexText, BorderLayout.NORTH);
                    regexText.setBorder(
                            BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 0)));
                    JCommonUtil.setFont(regexText);
                    regexText.getDocument().addDocumentListener(docListener);
                }
            }
        }
        this.setTitle("\u6b63\u5247\u8868\u793a\u5f0f");
        this.setSize(419, 320);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:org.jfree.chart.demo.TimeSeriesDemo13.java

/**
 * Creates a new demo instance.//from ww w. ja  v  a  2 s .c  om
 *
 * @param title  the frame title.
 */
public TimeSeriesDemo13(final String title) {

    super(title);

    final XYDataset dataset1 = createDataset(26);
    final JFreeChart chart1 = createChart(dataset1);
    final ChartPanel chartPanel1 = new ChartPanel(chart1);

    final XYDataset dataset2 = createDataset(1);
    final JFreeChart chart2 = createChart(dataset2);
    final ChartPanel chartPanel2 = new ChartPanel(chart2);

    final JTabbedPane tabs = new JTabbedPane();
    tabs.add("Chart 1", chartPanel1);
    tabs.add("Chart 2", chartPanel2);
    final JPanel content = new JPanel(new BorderLayout());
    content.setPreferredSize(new java.awt.Dimension(500, 270));
    content.add(tabs);
    setContentPane(content);

}

From source file:gtu._work.ui.ObnfExceptionLogDownloadUI.java

private void initGUI() {
    try {/* w  ww  .jav a  2  s.  c o m*/
        JCommonUtil.frameCloseConfirm(this);
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                FlowLayout jPanel1Layout = new FlowLayout();
                jTabbedPane1.addTab("", null, jPanel1, null);
                jPanel1.setLayout(jPanel1Layout);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("\u532f\u51fa\u76ee\u9304");
                }
                {
                    exportTextField = new JTextField();
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(exportTextField, true);
                    jPanel1.add(exportTextField);
                    exportTextField.setPreferredSize(new java.awt.Dimension(187, 22));
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("domainJar");
                    jLabel2.setPreferredSize(new java.awt.Dimension(56, 15));
                }
                {
                    domainJarText = new JTextField();
                    ObnfRepairDBBatch batch = new ObnfRepairDBBatch();
                    domainJarText.setText(batch.fetchDomainJar());
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(domainJarText, false);
                    jPanel1.add(domainJarText);
                    domainJarText.setPreferredSize(new java.awt.Dimension(185, 22));
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(512, 262));
                    {
                        messageIdArea = new JTextArea();
                        jScrollPane1.setViewportView(messageIdArea);
                    }
                }
                {
                    DefaultComboBoxModel jComboBox1Model = new DefaultComboBoxModel();
                    for (FtpSite f : FtpSite.values()) {
                        jComboBox1Model.addElement(f);
                    }
                    siteFtpComboBox = new JComboBox();
                    jPanel1.add(siteFtpComboBox);
                    siteFtpComboBox.setModel(jComboBox1Model);
                }
                {
                    downloadBtn = new JButton();
                    jPanel1.add(downloadBtn);
                    downloadBtn.setText("\u4e0b\u8f09");
                    downloadBtn.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            downloadBtnAction();
                        }
                    });
                }
                {
                    makeReportBtn = new JButton();
                    jPanel1.add(makeReportBtn);
                    makeReportBtn.setText("\u7522\u751f\u5831\u8868");
                    makeReportBtn.setPreferredSize(new java.awt.Dimension(102, 22));
                    makeReportBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            makeReportBtnPerformed();
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("log", null, jPanel2, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel2.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(529, 340));
                    {
                        logArea = new JTextArea();
                        jScrollPane2.setViewportView(logArea);
                    }
                }
            }
        }
        pack();
        this.setSize(542, 394);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:org.encog.workbench.tabs.visualize.weights.AnalyzeWeightsTab.java

public AnalyzeWeightsTab(ProjectEGFile encogObject) {
    super(encogObject);

    if (!(encogObject.getObject() instanceof BasicNetwork)) {
        throw new WorkBenchError(
                "Can't visualize weights of " + encogObject.getObject().getClass().getSimpleName());
    }//  ww  w.j av  a2 s . c  o  m

    this.network = (BasicNetwork) encogObject.getObject();
    this.analyze = new AnalyzeNetwork(this.network);

    this.setLayout(new BorderLayout());

    JPanel buttonPanel = new JPanel();
    add(buttonPanel, BorderLayout.SOUTH);

    this.buttonClose = new JButton("Close");
    buttonPanel.add(this.buttonClose);
    this.buttonClose.addActionListener(this);

    this.weightInfo = new WeightInfo(this);
    this.add(this.weightInfo, BorderLayout.NORTH);

    //
    createAllDataset();
    ChartPanel allChart = new ChartPanel(createChart(this.dataAll));
    ChartPanel weightChart = new ChartPanel(createChart(this.dataWeights));
    ChartPanel thresholdChart = new ChartPanel(createChart(this.dataThresholds));

    this.tabs = new JTabbedPane();
    this.add(tabs, BorderLayout.CENTER);
    this.tabs.addTab("Weights & Thresholds", allChart);
    this.tabs.addTab("Thresholds", weightChart);
    this.tabs.addTab("Weights", thresholdChart);

}

From source file:gtu.jpa.hibernate.Rcdf002eDBUI.java

private void initGUI() {
    try {/*ww  w . j av a  2  s. c o m*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                jTabbedPane1.addTab("?", null, jPanel1, null);
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u5f9e2e\u7522\u751fxml\u6a94");
                    executeBtn.setPreferredSize(new java.awt.Dimension(115, 36));
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed(evt);
                        }
                    });
                }
                {
                    isDebug = new JToggleButton();
                    jPanel1.add(isDebug);
                    isDebug.setPreferredSize(new java.awt.Dimension(232, 38));
                    JCommonUtil.setJToggleButtonText(isDebug, new String[] { "SIT", "?" });
                }
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("\u8a2d\u5b9axml\u8def\u5f91");
                }
                {
                    xmlFileText = new JTextField();
                    jPanel1.add(xmlFileText);
                    xmlFileText.setPreferredSize(new java.awt.Dimension(250, 24));
                }
                {
                    executeReportBtn = new JButton();
                    jPanel1.add(executeReportBtn);
                    executeReportBtn.setText("\u81eaxml\u6a94\u7522\u751f\u7d71\u8a08\u6a94");
                    executeReportBtn.setPreferredSize(new java.awt.Dimension(227, 64));
                    executeReportBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeReportBtnActionPerformed(evt);
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("log", null, jPanel2, null);
                jTabbedPane1.addTab("excel", null, getJPanel3(), null);
                jTabbedPane1.addTab("??", null, getJPanel4(), null);
                jTabbedPane1.addTab("", null, getJPanel5(), null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(407, 228));
                    {
                        logArea = new JTextArea();
                        jScrollPane1.setViewportView(logArea);
                    }
                }
            }
        }
        pack();
        this.setSize(420, 282);
        initLog();
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:gtu._work.etc.EnglishAdd.java

private void initGUI() {
    try {//from   w  w  w.j  a v a  2 s  .co m
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        this.setPreferredSize(new java.awt.Dimension(400, 211));
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            jTabbedPane1.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent evt) {
                    if (jTabbedPane1.getSelectedIndex() == 2) {
                        // XXX
                    }
                }
            });
            {
                jPanel1 = new JPanel();
                FlowLayout jPanel1Layout = new FlowLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("add", null, jPanel1, null);
                jPanel1.setPreferredSize(new java.awt.Dimension(387, 233));
                {
                    showwordText = new JTextField();
                    jPanel1.add(showwordText);
                    showwordText.setPreferredSize(new java.awt.Dimension(271, 23));
                    showwordText.addKeyListener(new KeyAdapter() {
                        public void keyPressed(KeyEvent evt) {
                            if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
                                scanWord();
                            }
                        }
                    });
                    showwordText.addFocusListener(new FocusAdapter() {
                        public void focusLost(FocusEvent evt) {
                            scanWord();
                        }
                    });
                }
                {
                    netChkBox = new JCheckBox();
                    jPanel1.add(netChkBox);
                    netChkBox.setSelected(true);
                }
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel1.add(jScrollPane2);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(364, 80));
                    {
                        showChineseArea = new JTextArea();
                        jScrollPane2.setViewportView(showChineseArea);
                        showChineseArea.setPreferredSize(new java.awt.Dimension(364, 80));
                    }
                }
                {
                    setFileBtn = new JButton();
                    jPanel1.add(setFileBtn);
                    setFileBtn.setText("set file");
                    setFileBtn.setPreferredSize(new java.awt.Dimension(261, 30));
                    setFileBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            File file = JCommonUtil._jFileChooser_selectFileOnly();
                            if (file == null) {
                                JCommonUtil._jOptionPane_showMessageDialog_error("?!");
                                return;
                            }
                            currentFile = file;

                            StringBuffer sb = new StringBuffer();
                            try {
                                BufferedReader reader = new BufferedReader(
                                        new InputStreamReader(new FileInputStream(currentFile), "BIG5"));
                                for (String line = null; (line = reader.readLine()) != null;) {
                                    sb.append(line + "\r\n");
                                }
                                reader.close();
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
                            wordTextArea.setText(sb.toString());
                        }
                    });
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("word", null, jPanel3, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel3.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(387, 224));
                    {
                        wordTextArea = new JTextArea();
                        jScrollPane1.setViewportView(wordTextArea);
                    }
                }
            }
        }

        setDefaultSave();

        pack();
        this.setSize(400, 211);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:de.interactive_instruments.ShapeChange.UI.DefaultDialog.java

public void initialise(Converter c, Options o, ShapeChangeResult r, String m) {
    converter = c;/*w w w.  ja  va 2 s . c o  m*/
    options = o;
    result = r;
    mdl = m;

    // frame
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JComponent newContentPane = new JPanel(new BorderLayout());
    newContentPane.setOpaque(true);
    setContentPane(newContentPane);

    // pane
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Main options", createTab1());
    tabbedPane.addTab("Secondary options", createTab2());
    newContentPane.add(tabbedPane);

    // frame size
    int height = 480;
    int width = 720;

    pack();

    Insets fI = getInsets();
    setSize(width + fI.right + fI.left, height + fI.top + fI.bottom);
    Dimension sD = Toolkit.getDefaultToolkit().getScreenSize();
    setLocation((sD.width - width) / 2, (sD.height - height) / 2);
}