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.db.sqlMaker.DbSqlCreaterUI.java

private void initGUI() {
    try {/*w ww . j av a  2 s. com*/
        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("URL");
                }
                {
                    urlText = new JTextField();
                    jPanel1.add(urlText);
                    urlText.setPreferredSize(new java.awt.Dimension(484, 24));
                    urlText.setText("jdbc:sqlserver://192.168.233.130:1433;DatabaseName=AAA03");
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("username");
                    jLabel2.setPreferredSize(new java.awt.Dimension(79, 17));
                }
                {
                    usernameText = new JTextField();
                    jPanel1.add(usernameText);
                    usernameText.setPreferredSize(new java.awt.Dimension(424, 24));
                    usernameText.setText("sa");
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("password");
                    jLabel3.setPreferredSize(new java.awt.Dimension(80, 17));
                }
                {
                    passwordText = new JTextField();
                    jPanel1.add(passwordText);
                    passwordText.setPreferredSize(new java.awt.Dimension(427, 24));
                    passwordText.setText("1234");
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText("tablename");
                    jLabel4.setPreferredSize(new java.awt.Dimension(65, 17));
                }
                {
                    tablenameText = new JTextField();
                    jPanel1.add(tablenameText);
                    tablenameText.setPreferredSize(new java.awt.Dimension(434, 24));
                    tablenameText.setText("AAA03.dbo.address");
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("");
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed(evt);
                        }
                    });
                }
            }
        }
        pack();
        this.setSize(558, 398);
        System.out.println("init ok!!");
    } catch (Exception e) {
        JCommonUtil.handleException(e);
    }
}

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

private void initGUI() {
    try {//  w  ww. ja  v a2 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();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel1.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(387, 246));
                    {
                        jTextArea1 = new JTextArea();
                        jScrollPane1.setViewportView(jTextArea1);
                        jTextArea1.setText("");
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                FlowLayout jPanel2Layout = new FlowLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    replaceFromText = new JTextField();
                    jPanel2.add(replaceFromText);
                    replaceFromText.setPreferredSize(new java.awt.Dimension(266, 22));
                }
                {
                    replaceToText = new JTextField();
                    jPanel2.add(replaceToText);
                    replaceToText.setPreferredSize(new java.awt.Dimension(266, 22));
                }
                {
                    execute = new JButton();
                    jPanel2.add(execute);
                    execute.setText("execute");
                    execute.setPreferredSize(new java.awt.Dimension(149, 42));
                    execute.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            try {
                                String text = jTextArea1.getText();
                                if (StringUtils.isBlank(text)) {
                                    JCommonUtil._jOptionPane_showMessageDialog_error("area empty!");
                                    return;
                                }

                                String fromTxt = replaceFromText.getText();
                                String toTxt = StringUtils.defaultString(replaceToText.getText());
                                if (StringUtils.isBlank(fromTxt)) {
                                    JCommonUtil._jOptionPane_showMessageDialog_error("fromTxt empty!");
                                    return;
                                }

                                StringBuffer sb = new StringBuffer();
                                Pattern ptn = Pattern.compile("(.){0,1}" + fromTxt + "(.){0,1}",
                                        Pattern.CASE_INSENSITIVE);
                                Matcher mth = null;

                                String[] scopeStrs = { ",", " ", "(", ")", "[", "]" };
                                BufferedReader reader = new BufferedReader(new StringReader(text));

                                for (String line = null; (line = reader.readLine()) != null;) {
                                    mth = ptn.matcher(line);
                                    while (mth.find()) {
                                        String scope1 = mth.group(1);
                                        String scope2 = mth.group(2);
                                        boolean ok1 = scope1.length() == 0
                                                || StringUtils.indexOfAny(scope1, scopeStrs) != -1;
                                        boolean ok2 = scope2.length() == 0
                                                || StringUtils.indexOfAny(scope2, scopeStrs) != -1;
                                        if (ok1 && ok2) {
                                            mth.appendReplacement(sb, scope1 + toTxt + scope2);
                                        }
                                    }
                                    mth.appendTail(sb);
                                    sb.append("\n");
                                }

                                reader.close();
                                jTextArea1.setText(sb.toString());
                            } catch (Exception e) {
                                JCommonUtil.handleException(e);
                            }
                        }

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

From source file:com.eviware.soapui.impl.rest.panels.resource.RestResourceDesktopPanel.java

private Component buildContent() {
    JTabbedPane tabs = new JTabbedPane();
    paramsTable = new RestParamsTable(getModelItem().getParams(), true, ParamLocation.RESOURCE, true, false);
    tabs.addTab("Resource Parameters", paramsTable);
    return UISupport.createTabPanel(tabs, false);
}

From source file:TabbedPaneDemo.java

public TabbedPaneDemo() {
    super(new GridLayout(1, 1));

    JTabbedPane tabbedPane = new JTabbedPane();
    ImageIcon icon = createImageIcon("images/middle.gif");

    JComponent panel1 = makeTextPanel("Panel #1");
    tabbedPane.addTab("Tab 1", icon, panel1, "Does nothing");
    tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

    JComponent panel2 = makeTextPanel("Panel #2");
    tabbedPane.addTab("Tab 2", icon, panel2, "Does twice as much nothing");
    tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);

    JComponent panel3 = makeTextPanel("Panel #3");
    tabbedPane.addTab("Tab 3", icon, panel3, "Still does nothing");
    tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);

    JComponent panel4 = makeTextPanel("Panel #4 (has a preferred size of 410 x 50).");
    panel4.setPreferredSize(new Dimension(410, 50));
    tabbedPane.addTab("Tab 4", icon, panel4, "Does nothing at all");
    tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);

    //Add the tabbed pane to this panel.
    add(tabbedPane);/*from   w  ww.  jav  a2s  .  c  om*/

    //Uncomment the following line to use scrolling tabs.
    //tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
}

From source file:gtu.xml.work.CacDBUI4Janna.java

private void initGUI() {
    try {// w w w. j  a  v 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();
                GridLayout jPanel1Layout = new GridLayout(10, 2, 5, 5);
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("\u8cc7\u6599\u8868\u540d\u7a31");
                }
                {
                    ComboBoxModel tableNameComboModel = new DefaultComboBoxModel(
                            new String[] { "cac_fcase", "cac_ecase", "cac_fcase_count" });
                    tableNameCombo = new JComboBox();
                    jPanel1.add(tableNameCombo);
                    tableNameCombo.setModel(tableNameComboModel);
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("xml\u6a94\u6848\u4f86\u6e90");
                }
                {
                    srcFileText = new JTextField();
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(srcFileText, false);
                    jPanel1.add(srcFileText);
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("\u7522\u751fsql\u6a94\u540d");
                }
                {
                    destFileNameText = new JTextField();
                    jPanel1.add(destFileNameText);
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText("dmv\u6b04\u4f4d\u503c");
                }
                {
                    dmvText = new JTextField();
                    jPanel1.add(dmvText);
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u57f7\u884c");
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed(evt);
                        }
                    });
                }
            }
        }
        pack();
        this.setSize(541, 361);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

From source file:org.gumtree.vis.awt.AbstractPlotEditor.java

/**
 * Standard constructor - the property panel is made up of a number of
 * sub-panels that are displayed in the tabbed pane.
 *
 * @param chart  the chart, whichs properties should be changed.
 *//*from w w w.ja  v  a 2  s  .c  om*/
public AbstractPlotEditor(IPlot plot) {
    setLayout(new BorderLayout());
    this.plot = plot;
    JPanel parts = new JPanel(new BorderLayout());
    tabs = new JTabbedPane();

    helpPanel = createHelpPanel();
    helpPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    tabs.addTab("Help", helpPanel);

    parts.add(tabs, BorderLayout.NORTH);
    add(parts);
}

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

private void initGUI() {
    try {//ww w .  ja  v a  2  s .c  om
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                GridLayout jPanel1Layout = new GridLayout(10, 1);
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("java\u6a94");
                }
                {
                    javaSrcFileText = new JTextField();
                    jPanel1.add(javaSrcFileText);
                    JCommonUtil.jTextFieldSetFilePathMouseEvent(javaSrcFileText, false);
                }
                {
                    jLabel2 = new JLabel();
                    jPanel1.add(jLabel2);
                    jLabel2.setText("method\u958b\u59cb");
                }
                {
                    methodStartText = new JTextField();
                    methodStartText.setText("\"#. ${method} .s\"");
                    jPanel1.add(methodStartText);
                }
                {
                    jLabel3 = new JLabel();
                    jPanel1.add(jLabel3);
                    jLabel3.setText("method\u7d50\u675f");
                }
                {
                    methodEndText = new JTextField();
                    methodEndText.setText("\"#. ${method} .e\"");
                    jPanel1.add(methodEndText);
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText(
                            "\u7528\u684c\u9762\u8a2d\u5b9a\u6a94\u6c7a\u5b9adebug\u958b\u8d77\u6216\u95dc\u9589");
                }
                {
                    ComboBoxModel onOffDebugSwitchComboBoxModel = new DefaultComboBoxModel(
                            new String[] { "false", "true" });
                    onOffDebugSwitchComboBox = new JComboBox();
                    jPanel1.add(onOffDebugSwitchComboBox);
                    onOffDebugSwitchComboBox.setModel(onOffDebugSwitchComboBoxModel);
                }
                {
                    executeBtn = new JButton();
                    jPanel1.add(executeBtn);
                    executeBtn.setText("\u57f7\u884c");
                    executeBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            executeBtnActionPerformed(evt);
                        }
                    });
                }
            }
        }
        pack();
        this.setSize(587, 404);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

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

private void initGUI() {
    try {/*  w w  w . ja  v a  2  s .  c om*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            {
                jPanel1 = new JPanel();
                BorderLayout jPanel1Layout = new BorderLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("jPanel1", null, jPanel1, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel1.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(525, 267));
                    {
                        ListModel jList1Model = new DefaultListModel();
                        jList1 = new JList();

                        jScrollPane2.setViewportView(jList1);
                        jList1.addKeyListener(new KeyAdapter() {
                            public void keyPressed(KeyEvent evt) {
                                JListUtil.newInstance(jList1).defaultJListKeyPressed(evt);
                            }
                        });
                        jList1.setModel(jList1Model);
                    }
                }
                {
                    jButton1 = new JButton();
                    jPanel1.add(jButton1, BorderLayout.NORTH);
                    jButton1.setText("\u8cbc\u4e0a");
                    jButton1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton1ActionPerformed(evt);
                        }
                    });
                }
                {
                    jPanel3 = new JPanel();
                    FlowLayout jPanel3Layout = new FlowLayout();
                    jPanel3Layout.setAlignment(FlowLayout.RIGHT);
                    jPanel1.add(jPanel3, BorderLayout.WEST);
                    jPanel3.setLayout(jPanel3Layout);
                    jPanel3.setPreferredSize(new java.awt.Dimension(50, 291));
                    {
                        jCheckBox1 = new JCheckBox();
                        jPanel3.add(jCheckBox1);
                        jCheckBox1.setText("\\n");
                    }
                    {
                        jCheckBox2 = new JCheckBox();
                        jPanel3.add(jCheckBox2);
                        jCheckBox2.setText("\\t");
                    }
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("jPanel2", null, jPanel2, null);
                {
                    jButton2 = new JButton();
                    jPanel2.add(jButton2, BorderLayout.NORTH);
                    jButton2.setText("\u7522\u751f");
                    jButton2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            jButton2ActionPerformed(evt);
                        }
                    });
                }
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(525, 291));
                    {
                        jTextArea1 = new JTextArea();
                        jScrollPane1.setViewportView(jTextArea1);
                        jTextArea1.setText("");
                    }
                }
            }
        }
        pack();
        this.setSize(546, 382);
    } catch (Exception e) {
        // add your error handling code here
        e.printStackTrace();
    }
}

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

private void initGUI() {
    try {//from  w w  w. j  a  va 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();
                FlowLayout jPanel1Layout = new FlowLayout();
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("?", null, jPanel1, null);
                {
                    DefaultComboBoxModel countryComboBoxModel = new DefaultComboBoxModel();
                    for (CountyEnum e : CountyEnum.values()) {
                        countryComboBoxModel.addElement(e.countyLabel);
                    }
                    countryComboBox = new JComboBox();
                    jPanel1.add(countryComboBox);
                    countryComboBox.setModel(countryComboBoxModel);
                }
                {
                    ComboBoxModel passRetryComboBoxModel = new DefaultComboBoxModel(
                            new String[] { "byPass", "reTry", "status" });
                    passRetryComboBox = new JComboBox();
                    jPanel1.add(passRetryComboBox);
                    passRetryComboBox.setModel(passRetryComboBoxModel);
                }
                {
                    sendBtn = new JButton();
                    jPanel1.add(sendBtn);
                    sendBtn.setText("\u9001\u51fa");
                    sendBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            //TODO add your code for sendBtn.actionPerformed
                            new Thread(new Runnable() {
                                @Override
                                public void run() {
                                    readMessageId();
                                }
                            }).start();
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("messageId", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(604, 375));
                    {
                        messageIdArea = new JTextArea();
                        jScrollPane1.setViewportView(messageIdArea);
                    }
                }
            }
            {
                jPanel3 = new JPanel();
                BorderLayout jPanel3Layout = new BorderLayout();
                jPanel3.setLayout(jPanel3Layout);
                jTabbedPane1.addTab("?", null, jPanel3, null);
                {
                    jScrollPane2 = new JScrollPane();
                    jPanel3.add(jScrollPane2, BorderLayout.CENTER);
                    jScrollPane2.setPreferredSize(new java.awt.Dimension(604, 375));
                    {
                        executeLogArea = new JTextArea();
                        jScrollPane2.setViewportView(executeLogArea);
                    }
                }
            }
        }
        pack();
        this.setSize(617, 429);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

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

private void initGUI() {
    try {/*from ww w .  j ava2 s.  c o m*/
        BorderLayout thisLayout = new BorderLayout();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(thisLayout);
        {
            jTabbedPane1 = new JTabbedPane();
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
            jTabbedPane1.setPreferredSize(new java.awt.Dimension(717, 582));
            {
                jPanel1 = new JPanel();
                GridLayout jPanel1Layout = new GridLayout(15, 1);
                jPanel1.setLayout(jPanel1Layout);
                jTabbedPane1.addTab("", null, jPanel1, null);
                {
                    jLabel1 = new JLabel();
                    jPanel1.add(jLabel1);
                    jLabel1.setText("entity\u540d\u7a31");
                }
                {
                    entityNameText = new JTextField();
                    jPanel1.add(entityNameText);
                }
                {
                    jLabel4 = new JLabel();
                    jPanel1.add(jLabel4);
                    jLabel4.setText("DAOImpl\u540d\u7a31");
                }
                {
                    daoImplText = new JTextField();
                    jPanel1.add(daoImplText);
                }
                {
                    jLabel5 = new JLabel();
                    jPanel1.add(jLabel5);
                    jLabel5.setText("DAOInterface\u540d\u7a31");
                }
                {
                    daoInterfaceText = new JTextField();
                    jPanel1.add(daoInterfaceText);
                }
                {
                    updateBtn = new JButton();
                    jPanel1.add(updateBtn);
                    updateBtn.setText("\u66f4\u65b0");
                    updateBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            updateBtnActionPerformed(evt);
                        }
                    });
                }
                {
                    makeFileBtn = new JButton();
                    jPanel1.add(makeFileBtn);
                    makeFileBtn.setText("\u7522\u751f\u6a94\u6848");
                    makeFileBtn.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            try {
                                makeFileBtnActionPerformed(evt);
                            } catch (IOException e) {
                                JCommonUtil.handleException(e);
                            }
                        }
                    });
                }
            }
            {
                jPanel2 = new JPanel();
                BorderLayout jPanel2Layout = new BorderLayout();
                jPanel2.setLayout(jPanel2Layout);
                jTabbedPane1.addTab("xml", null, jPanel2, null);
                {
                    jScrollPane1 = new JScrollPane();
                    jPanel2.add(jScrollPane1, BorderLayout.CENTER);
                    jScrollPane1.setPreferredSize(new java.awt.Dimension(712, 458));
                    {
                        jScrollPane2 = new JScrollPane();
                        jScrollPane1.setViewportView(jScrollPane2);
                        {
                            xmlConfigArea = new JTextArea();
                            jScrollPane2.setViewportView(xmlConfigArea);
                        }
                    }
                }
            }
        }
        pack();
        this.setSize(733, 525);
    } catch (Exception e) {
        e.printStackTrace();
    }
}