Example usage for javax.swing.border TitledBorder CENTER

List of usage examples for javax.swing.border TitledBorder CENTER

Introduction

In this page you can find the example usage for javax.swing.border TitledBorder CENTER.

Prototype

int CENTER

To view the source code for javax.swing.border TitledBorder CENTER.

Click Source Link

Document

Position title text in the center of the border line.

Usage

From source file:customize.swing.startMain.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - unknown
    panel1 = new JPanel();
    JPanel panel2 = new JPanel();
    JScrollPane scrollPane1 = new JScrollPane();
    JPanel panel3 = new JPanel();
    JPanel panel4 = new JPanel();
    JPanel panel5 = new JPanel();
    textField6 = new JTextField();
    JPanel panel6 = new JPanel();
    JLabel label1 = new JLabel();
    JPanel panel7 = new JPanel();
    JLabel label2 = new JLabel();
    JPanel panel8 = new JPanel();
    JLabel label3 = new JLabel();
    JPanel panel9 = new JPanel();
    textField2 = new JTextField();
    ButtonView = new JButton();
    JPanel panel10 = new JPanel();
    textField7 = new JTextField();
    JPanel panel11 = new JPanel();
    textField1 = new JTextField();
    JPanel panel12 = new JPanel();
    JLabel label4 = new JLabel();
    JPanel panel13 = new JPanel();
    CheckBox1 = new JCheckBox();
    CheckBox2 = new JCheckBox();
    JPanel panel14 = new JPanel();
    genButton = new JButton();
    JScrollPane scrollPane2 = new JScrollPane();
    JPanel panel15 = new JPanel();
    JPanel panel16 = new JPanel();
    TextField = new JTextField();
    JPanel panel17 = new JPanel();
    textField3 = new JTextField();
    JPanel panel18 = new JPanel();
    rootTextField = new JTextField();
    JPanel panel19 = new JPanel();
    PasswordField = new JPasswordField();
    JPanel panel20 = new JPanel();
    textField8 = new JTextField();
    JPanel panel21 = new JPanel();
    JLabel label5 = new JLabel();
    JPanel panel22 = new JPanel();
    JLabel label6 = new JLabel();
    JPanel panel23 = new JPanel();
    JLabel label7 = new JLabel();
    JPanel panel24 = new JPanel();
    JLabel label8 = new JLabel();
    JPanel panel25 = new JPanel();
    JLabel label9 = new JLabel();
    JScrollPane scrollPane3 = new JScrollPane();
    jscrollPane1 = new JTextPane();

    //======== panel1 ========
    {/* w w  w.  j a  v  a 2  s. co  m*/

        // JFormDesigner evaluation mark
        panel1.setBorder(new javax.swing.border.CompoundBorder(
                new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                        "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                        javax.swing.border.TitledBorder.BOTTOM,
                        new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red),
                panel1.getBorder()));
        panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent e) {
                if ("border".equals(e.getPropertyName()))
                    throw new RuntimeException();
            }
        });

        panel1.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1));

        //======== panel2 ========
        {
            panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));

            //======== scrollPane1 ========
            {
                scrollPane1.setBorder(new TitledBorder("\u6587\u4ef6\u751f\u6210\u5730\u5740"));

                //======== panel3 ========
                {
                    panel3.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));

                    //======== panel4 ========
                    {
                        panel4.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //======== panel5 ========
                        {
                            panel5.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                            //---- textField6 ----
                            textField6.setEditable(true);
                            textField6.setEnabled(true);
                            textField6.setText("");
                            textField6.putClientProperty("html.disable", false);
                            panel5.add(textField6,
                                    new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                            GridConstraints.FILL_HORIZONTAL,
                                            GridConstraints.SIZEPOLICY_CAN_GROW
                                                    | GridConstraints.SIZEPOLICY_WANT_GROW,
                                            GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                        }
                        panel4.add(panel5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));
                    }
                    panel3.add(panel4,
                            new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel6 ========
                    {
                        panel6.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- label1 ----
                        label1.setText("xml\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b");
                        panel6.add(label1,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                        GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel6,
                            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel7 ========
                    {
                        panel7.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- label2 ----
                        label2.setText("model\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b");
                        panel7.add(label2,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                        GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel7,
                            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel8 ========
                    {
                        panel8.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- label3 ----
                        label3.setText("\u6587\u4ef6\u7edf\u4e00\u751f\u6210\u8def\u5f84");
                        panel8.add(label3,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                        GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel8,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel9 ========
                    {
                        panel9.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
                        panel9.add(textField2,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                        GridConstraints.FILL_HORIZONTAL,
                                        GridConstraints.SIZEPOLICY_CAN_GROW
                                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));

                        //---- ButtonView ----
                        ButtonView.setText("\u6d4f\u89c8");
                        panel9.add(ButtonView,
                                new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                        GridConstraints.FILL_HORIZONTAL,
                                        GridConstraints.SIZEPOLICY_CAN_SHRINK
                                                | GridConstraints.SIZEPOLICY_CAN_GROW,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel9,
                            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel10 ========
                    {
                        panel10.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- textField7 ----
                        textField7.setEditable(true);
                        textField7.setEnabled(true);
                        textField7.setText("");
                        textField7.putClientProperty("html.disable", true);
                        panel10.add(textField7,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                        GridConstraints.FILL_HORIZONTAL,
                                        GridConstraints.SIZEPOLICY_CAN_GROW
                                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel10,
                            new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel11 ========
                    {
                        panel11.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- textField1 ----
                        textField1.setEditable(true);
                        textField1.setEnabled(true);
                        textField1.setText("");
                        textField1.putClientProperty("html.disable", true);
                        panel11.add(textField1,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                        GridConstraints.FILL_HORIZONTAL,
                                        GridConstraints.SIZEPOLICY_CAN_GROW
                                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel11,
                            new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));

                    //======== panel12 ========
                    {
                        panel12.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                        //---- label4 ----
                        label4.setText("dao\u5c42\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b");
                        panel12.add(label4,
                                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                        GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                        GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                    }
                    panel3.add(panel12,
                            new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_BOTH,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                    null, null, null));
                }
                scrollPane1.setViewportView(panel3);
            }
            panel2.add(scrollPane1,
                    new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                    | GridConstraints.SIZEPOLICY_WANT_GROW,
                            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                    | GridConstraints.SIZEPOLICY_WANT_GROW,
                            null, null, null));
        }
        panel1.add(panel2,
                new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                        null));

        //======== panel13 ========
        {
            panel13.setBorder(new TitledBorder("\u53ef\u914d\u7f6e\u9879"));
            panel13.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));

            //---- CheckBox1 ----
            CheckBox1.setSelected(true);
            CheckBox1.setText("\u662f\u5426\u4e3a\u9a7c\u5cf0\u547d\u540d\u89c4\u8303");
            panel13.add(CheckBox1,
                    new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                            GridConstraints.SIZEPOLICY_FIXED, null, null, null));

            //---- CheckBox2 ----
            CheckBox2.setSelected(true);
            CheckBox2.setText("\u662f\u5426\u751f\u6210\u6ce8\u91ca");
            panel13.add(CheckBox2,
                    new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                            GridConstraints.SIZEPOLICY_FIXED, null, null, null));
        }
        panel1.add(panel13,
                new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                        null));

        //======== panel14 ========
        {
            panel14.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

            //---- genButton ----
            genButton.setText("\u751f\u6210");
            panel14.add(genButton,
                    new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                            GridConstraints.FILL_HORIZONTAL,
                            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                            GridConstraints.SIZEPOLICY_FIXED, null, null, null));
        }
        panel1.add(panel14,
                new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                        null));

        //======== scrollPane2 ========
        {
            scrollPane2.setBorder(new TitledBorder("\u5fc5\u586b\u9879"));

            //======== panel15 ========
            {
                panel15.setLayout(new GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));

                //======== panel16 ========
                {
                    panel16.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- TextField ----
                    TextField.setText("com.mysql.jdbc.Driver");
                    panel16.add(TextField,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                    GridConstraints.FILL_HORIZONTAL,
                                    GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel16,
                        new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel17 ========
                {
                    panel17.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- textField3 ----
                    textField3.setText("jdbc:mysql://192.168.0.13/mvp?characterEncoding=UTF-8");
                    panel17.add(textField3,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                    GridConstraints.FILL_HORIZONTAL,
                                    GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel17,
                        new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel18 ========
                {
                    panel18.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- rootTextField ----
                    rootTextField.setText("root");
                    panel18.add(rootTextField,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                    GridConstraints.FILL_HORIZONTAL,
                                    GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel18,
                        new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel19 ========
                {
                    panel19.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- PasswordField ----
                    PasswordField.setText("elab@123");
                    panel19.add(PasswordField,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                    GridConstraints.FILL_HORIZONTAL,
                                    GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel19,
                        new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel20 ========
                {
                    panel20.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- textField8 ----
                    textField8.setText("");
                    panel20.add(textField8,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
                                    GridConstraints.FILL_HORIZONTAL,
                                    GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel20,
                        new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel21 ========
                {
                    panel21.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- label5 ----
                    label5.setText("\u6570\u636e\u5e93\u9a71\u52a8:");
                    panel21.add(label5,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel21,
                        new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel22 ========
                {
                    panel22.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- label6 ----
                    label6.setText("\u6570\u636e\u5e93\u8fde\u63a5\u5730\u5740:");
                    panel22.add(label6,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel22,
                        new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel23 ========
                {
                    panel23.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- label7 ----
                    label7.setText("\u6570\u636e\u5e93\u7528\u6237\u540d:");
                    panel23.add(label7,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel23,
                        new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel24 ========
                {
                    panel24.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- label8 ----
                    label8.setText("\u6570\u636e\u5e93\u5bc6\u7801:");
                    panel24.add(label8,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel24,
                        new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));

                //======== panel25 ========
                {
                    panel25.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));

                    //---- label9 ----
                    label9.setText("\u8868\u540d(\u53ef\u6a21\u7cca%)");
                    panel25.add(label9,
                            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                    GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
                                    GridConstraints.SIZEPOLICY_FIXED, null, null, null));
                }
                panel15.add(panel25,
                        new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER,
                                GridConstraints.FILL_BOTH,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                                null, null, null));
            }
            scrollPane2.setViewportView(panel15);
        }
        panel1.add(scrollPane2,
                new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                        null, null, null));

        //======== scrollPane3 ========
        {
            scrollPane3.setBorder(new TitledBorder("\u6ce8\u610f\u4e8b\u9879"));

            //---- jscrollPane1 ----
            jscrollPane1.setEditable(true);
            jscrollPane1.setEnabled(true);
            jscrollPane1.setText(
                    "\t1.\u8bf7\u4e0d\u8981\u91cd\u590d\u751f\u6210\u540c\u6837\u7684\u6587\u4ef6\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u5939\u4e0b\u3002");
            scrollPane3.setViewportView(jscrollPane1);
        }
        panel1.add(scrollPane3,
                new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                        GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW
                                | GridConstraints.SIZEPOLICY_WANT_GROW,
                        null, null, null));
    }
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:aplicarFiltros.PanelResultado.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Sebastian Colavita
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    panel2 = new JPanel();
    panel1 = new JPanel();
    scrollPaneRasgos2 = new JScrollPane();
    tableRasgos2 = new JTable();
    button1 = new JButton();
    separator1 = compFactory.createSeparator("Clasificaci\u00f3n");
    label1 = new JLabel();
    resultado = new JLabel();
    label2 = new JLabel();
    Descuento = new JLabel();
    panel3 = new JPanel();
    panelGraficoPixel = new JPanel();

    //======== this ========

    // JFormDesigner evaluation mark
    setBorder(// w ww.j  a  v  a2s . com
            new javax.swing.border.CompoundBorder(
                    new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                            "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                            javax.swing.border.TitledBorder.BOTTOM,
                            new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red),
                    getBorder()));
    addPropertyChangeListener(new java.beans.PropertyChangeListener() {
        public void propertyChange(java.beans.PropertyChangeEvent e) {
            if ("border".equals(e.getPropertyName()))
                throw new RuntimeException();
        }
    });

    setLayout(null);

    //======== panel2 ========
    {
        panel2.setBackground(Color.blue);
        panel2.setLayout(null);

        //======== panel1 ========
        {
            panel1.setBorder(new BevelBorder(BevelBorder.RAISED));
            panel1.setLayout(null);

            //======== scrollPaneRasgos2 ========
            {

                //---- tableRasgos2 ----
                tableRasgos2.setModel(new DefaultTableModel(new Object[][] {},
                        new String[] { "Clasificaciones", "Cantidad", "Porcentaje Area" }) {
                    Class<?>[] columnTypes = new Class<?>[] { String.class, String.class, Object.class };

                    @Override
                    public Class<?> getColumnClass(int columnIndex) {
                        return columnTypes[columnIndex];
                    }
                });
                tableRasgos2.setPreferredScrollableViewportSize(new Dimension(200, 100));
                tableRasgos2.setBackground(UIManager.getColor("RadioButton.light"));
                tableRasgos2.setCellSelectionEnabled(true);
                scrollPaneRasgos2.setViewportView(tableRasgos2);
            }
            panel1.add(scrollPaneRasgos2);
            scrollPaneRasgos2.setBounds(10, 60, 605, 155);

            //---- button1 ----
            button1.setIcon(new ImageIcon("\\\\img\\\\maiz_mon810_al.jpg"));
            panel1.add(button1);
            button1.setBounds(620, 60, 225, 155);
            panel1.add(separator1);
            separator1.setBounds(10, 5, 835, separator1.getPreferredSize().height);

            //---- label1 ----
            label1.setText("Resultado:");
            label1.setFont(new Font("Times New Roman", Font.BOLD, 13));
            panel1.add(label1);
            label1.setBounds(10, 35, 67, label1.getPreferredSize().height);

            //---- resultado ----
            resultado.setText("Grado A");
            resultado.setFont(new Font("Times New Roman", Font.BOLD, 13));
            resultado.setForeground(Color.blue);
            panel1.add(resultado);
            resultado.setBounds(79, 35, 171, 19);

            //---- label2 ----
            label2.setText(" Descuento:");
            label2.setFont(new Font("Times New Roman", Font.BOLD, 13));
            panel1.add(label2);
            label2.setBounds(250, 35, 72, 19);

            //---- Descuento ----
            Descuento.setText("10%");
            Descuento.setFont(new Font("Times New Roman", Font.BOLD, 13));
            Descuento.setForeground(Color.blue);
            panel1.add(Descuento);
            Descuento.setBounds(320, 35, 60, Descuento.getPreferredSize().height);

            { // compute preferred size
                Dimension preferredSize = new Dimension();
                for (int i = 0; i < panel1.getComponentCount(); i++) {
                    Rectangle bounds = panel1.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = panel1.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                panel1.setMinimumSize(preferredSize);
                panel1.setPreferredSize(preferredSize);
            }
        }
        panel2.add(panel1);
        panel1.setBounds(15, 10, 856, 225);

        //======== panel3 ========
        {
            panel3.setBorder(new TitledBorder("Gr\u00e1ficos"));
            panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));

            //======== panelGraficoPixel ========
            {
                panelGraficoPixel.setLayout(null);

                { // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for (int i = 0; i < panelGraficoPixel.getComponentCount(); i++) {
                        Rectangle bounds = panelGraficoPixel.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panelGraficoPixel.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panelGraficoPixel.setMinimumSize(preferredSize);
                    panelGraficoPixel.setPreferredSize(preferredSize);
                }
            }
            panel3.add(panelGraficoPixel);
        }
        panel2.add(panel3);
        panel3.setBounds(13, 245, 857, 355);

        { // compute preferred size
            Dimension preferredSize = new Dimension();
            for (int i = 0; i < panel2.getComponentCount(); i++) {
                Rectangle bounds = panel2.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = panel2.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            panel2.setMinimumSize(preferredSize);
            panel2.setPreferredSize(preferredSize);
        }
    }
    add(panel2);
    panel2.setBounds(10, 5, 883, 610);

    { // compute preferred size
        Dimension preferredSize = new Dimension();
        for (int i = 0; i < getComponentCount(); i++) {
            Rectangle bounds = getComponent(i).getBounds();
            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
        }
        Insets insets = getInsets();
        preferredSize.width += insets.right;
        preferredSize.height += insets.bottom;
        setMinimumSize(preferredSize);
        setPreferredSize(preferredSize);
    }
    // JFormDesigner - End of component initialization  //GEN-END:initComponents

    button1.setIcon(new ImageIcon("img\\maiz_mon810_al.jpg"));
}

From source file:JXButtonPanel.java

private JPanel createButtonJXButtonPanel() {
    JPanel ret = new JPanel(new BorderLayout());
    JLabel label = new JLabel("Does JXButtonPanel support arrow keys ?");
    label.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
    JPanel temp = new JPanel();
    temp.add(label);//from   www.j a v  a 2s. c om
    ret.add(temp);

    JXButtonPanel panel = new JXButtonPanel();
    panel.setCyclic(true);
    panel.add(new JButton("Yes"));
    panel.add(new JButton("Sure"));
    panel.add(new JButton("Absolutely !"));
    panel.setBorder(BorderFactory.createTitledBorder(null, "JXButtonPanel.setCyclic(true)", TitledBorder.CENTER,
            TitledBorder.BOTTOM));
    ret.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

    ret.add(panel, BorderLayout.SOUTH);
    return ret;
}

From source file:gov.nih.nci.nbia.StandaloneDMV3.java

private JPanel constructLoginPanel() {
    JPanel contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(36, 36, 36, 36));
    contentPane.setLayout(null);//  w w w.  ja  v a  2s.co m

    JPanel guestPanel = new JPanel();
    guestPanel.setBounds(38, 40, 825, 140);
    guestPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED, new Color(153, 180, 209), null),
            "  For Guest  ", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 120, 215)));
    contentPane.add(guestPanel);
    guestPanel.setLayout(null);

    JButton guestBtn = new JButton(GuestBtnLbl);
    guestBtn.setBounds(606, 50, 140, 36);
    guestBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            submitRequest(null, null);
        }
    });
    guestPanel.add(guestBtn);

    JLabel guestLbl = new JLabel("Log in as a guest to download public data only");
    guestLbl.setBounds(70, 50, 460, 42);
    guestPanel.add(guestLbl);

    JPanel loginUserPanel = new JPanel();
    loginUserPanel.setBounds(40, 258, 825, 306);
    contentPane.add(loginUserPanel);
    loginUserPanel
            .setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(153, 180, 209), null),
                    "  Login to Download Authorized Data  ", TitledBorder.CENTER, TitledBorder.TOP, null,
                    new Color(0, 120, 215)));
    loginUserPanel.setLayout(null);

    JLabel lblNewLabel_1 = new JLabel("User Name");
    lblNewLabel_1.setBounds(70, 80, 118, 36);
    loginUserPanel.add(lblNewLabel_1);

    JButton submitBtn = new JButton(SubmitBtnLbl);
    submitBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            userId = userNameFld.getText();
            password = passwdFld.getText();
            if ((userId.length() < 1) || (password.length() < 1)) {
                statusLbl.setText("Please enter a valid user name and password.");
                statusLbl.setForeground(Color.red);
            } else {
                submitRequest(userId, password);
            }
        }
    });
    submitBtn.setBounds(606, 238, 140, 36);
    loginUserPanel.add(submitBtn);

    userNameFld = new JTextField();
    userNameFld.setBounds(200, 80, 333, 36);
    loginUserPanel.add(userNameFld);
    userNameFld.setColumns(10);

    JLabel lblPassword = new JLabel("Password");
    lblPassword.setBounds(70, 156, 118, 36);
    loginUserPanel.add(lblPassword);

    passwdFld = new JPasswordField();
    passwdFld.setBounds(200, 156, 333, 36);
    loginUserPanel.add(passwdFld);

    statusLbl = new JLabel("");
    statusLbl.setBounds(70, 226, 463, 36);
    loginUserPanel.add(statusLbl);

    JLabel lblOr = new JLabel("--- OR ---");
    lblOr.setBounds(419, 212, 81, 26);
    contentPane.add(lblOr);

    JLabel versionLabel = new JLabel("Release " + DownloaderProperties.getAppVersion() + " Build \""
            + DownloaderProperties.getBuildTime() + "\"");
    versionLabel.setHorizontalAlignment(SwingConstants.CENTER);
    versionLabel.setForeground(new Color(70, 130, 180));
    versionLabel.setBounds(315, 584, 260, 20);
    contentPane.add(versionLabel);

    userNameFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            passwdFld.requestFocus();
        }
    });

    userNameFld.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            statusLbl.setText("");
        }

        @Override
        public void focusLost(FocusEvent e) {
        }
    });

    passwdFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            userId = userNameFld.getText();
            password = passwdFld.getText();
            if ((userId.length() < 1) || (password.length() < 1)) {
                statusLbl.setText("Please enter a valid user name and password.");
                statusLbl.setForeground(Color.red);
            } else
                submitRequest(userId, password);
        }
    });

    passwdFld.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            statusLbl.setText("");
        }

        @Override
        public void focusLost(FocusEvent e) {
        }
    });

    return contentPane;
}

From source file:gov.nih.nci.nbia.StandaloneDMV3.java

/**
 * Create the panel./*from   w  w  w .  j  av  a2s  .  c  o  m*/
 */
private JPanel createloginPanelV2() {
    JPanel contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(36, 36, 36, 36));
    contentPane.setLayout(null);

    JPanel loginUserPanel = new JPanel();
    loginUserPanel.setBounds(40, 91, 825, 306);
    contentPane.add(loginUserPanel);
    loginUserPanel
            .setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(153, 180, 209), null),
                    "", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 120, 215)));
    loginUserPanel.setLayout(null);

    JLabel lblNewLabel_1 = new JLabel("User Name");
    lblNewLabel_1.setBounds(70, 80, 118, 36);
    loginUserPanel.add(lblNewLabel_1);

    JButton submitBtn = new JButton(SubmitBtnLbl);
    submitBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            userId = userNameFld.getText();
            password = passwdFld.getText();
            if ((userId.length() < 1) || (password.length() < 1)) {
                setStatus(statusLbl, "Please enter a valid user name and password.", Color.red);
            } else {
                setStatus(statusLbl, "Checking your access permission...", Color.blue);
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        submitRequest(userId, password);
                    }
                });
            }
        }
    });
    submitBtn.setBounds(606, 238, 140, 36);
    loginUserPanel.add(submitBtn);

    userNameFld = new JTextField();
    userNameFld.setBounds(200, 80, 333, 36);
    loginUserPanel.add(userNameFld);
    userNameFld.setColumns(10);

    JLabel lblPassword = new JLabel("Password");
    lblPassword.setBounds(70, 156, 118, 36);
    loginUserPanel.add(lblPassword);

    passwdFld = new JPasswordField();
    passwdFld.setBounds(200, 156, 333, 36);
    loginUserPanel.add(passwdFld);

    statusLbl = new JLabel("");
    statusLbl.setBounds(70, 226, 524, 36);
    statusLbl.setFont(new Font("SansSerif", Font.PLAIN, 13));
    statusLbl.setVerticalAlignment(SwingConstants.BOTTOM);
    loginUserPanel.add(statusLbl);

    JLabel versionLabel = new JLabel("Release " + DownloaderProperties.getAppVersion() + " Build \""
            + DownloaderProperties.getBuildTime() + "\"");
    versionLabel.setHorizontalAlignment(SwingConstants.CENTER);
    versionLabel.setForeground(new Color(70, 130, 180));
    versionLabel.setBounds(318, 427, 266, 20);
    contentPane.add(versionLabel);

    JLabel infoLbl = new JLabel(
            "This download contains restricted data. Log in or contact the help desk for access.");
    infoLbl.setForeground(new Color(105, 105, 105));
    infoLbl.setFont(new Font("SansSerif", Font.BOLD, 13));
    infoLbl.setBounds(40, 34, 796, 42);
    contentPane.add(infoLbl);

    JLabel helpDeskLbl;

    helpDeskLbl = new JLabel();
    ImageIcon image = new ImageIcon(this.getClass().getClassLoader().getResource("info.png"));
    helpDeskLbl = new JLabel(image);
    helpDeskLbl.setToolTipText("Click to get phone number/email address of the Help Desk.");
    helpDeskLbl.setBounds(826, 20, 36, 36);
    contentPane.add(helpDeskLbl);

    helpDeskLbl.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            System.out.println("mouse clicked");
            //BrowserLauncher.openUrl(DownloaderProperties.getHelpDeskUrl());
            BrowserLauncher.openUrlForHelpDesk();
        }

    });

    userNameFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            passwdFld.requestFocus();
        }
    });

    userNameFld.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            statusLbl.setText("");
        }

        @Override
        public void focusLost(FocusEvent e) {
        }
    });

    passwdFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            userId = userNameFld.getText();
            password = passwdFld.getText();
            if ((userId.length() < 1) || (password.length() < 1)) {
                setStatus(statusLbl, "Please enter a valid user name and password.", Color.red);
            } else {
                setStatus(statusLbl, "Checking your access permission...", Color.blue);
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        submitRequest(userId, password);
                    }
                });
            }
        }
    });

    passwdFld.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            statusLbl.setText("");
        }

        @Override
        public void focusLost(FocusEvent e) {
        }
    });

    return contentPane;
}

From source file:JXTransformer.java

private JPanel createStressTestPanel() {
        JPanel panel = new JPanel();
        TitledBorder titledBorder = BorderFactory.createTitledBorder("Stress test (with tooltips)");
        titledBorder.setTitleJustification(TitledBorder.CENTER);
        panel.setBorder(titledBorder);/*from   www . j  a  v a 2 s . com*/
        JButton lowerButton = new JButton("Button");
        lowerButton.setLayout(new FlowLayout());
        lowerButton.setToolTipText("Lower button");
        JButton middleButton = new JButton();
        middleButton.setToolTipText("Middle button");
        middleButton.setLayout(new FlowLayout());
        lowerButton.add(middleButton);
        JButton upperButton = new JButton("Upper button");
        upperButton.setToolTipText("Upper button");
        middleButton.add(upperButton);
        panel.add(createTransformer(lowerButton));
        return panel;
    }

From source file:JXTransformer.java

private JPanel createDemoPanel() {
        JPanel buttonPanel = new JPanel(new GridLayout(3, 2));
        TitledBorder titledBorder = BorderFactory.createTitledBorder("Try three sliders below !");
        Font titleFont = titledBorder.getTitleFont();
        titledBorder.setTitleFont(titleFont.deriveFont(titleFont.getSize2D() + 10));
        titledBorder.setTitleJustification(TitledBorder.CENTER);
        buttonPanel.setBorder(titledBorder);
        JButton b = new JButton("JButton");
        b.setPreferredSize(new Dimension(100, 50));
        buttonPanel.add(createTransformer(b));

        Vector<String> v = new Vector<String>();
        v.add("One");
        v.add("Two");
        v.add("Three");
        JList list = new JList(v);
        buttonPanel.add(createTransformer(list));

        buttonPanel.add(createTransformer(new JCheckBox("JCheckBox")));

        JSlider slider = new JSlider(0, 100);
        slider.setLabelTable(slider.createStandardLabels(25, 0));
        slider.setPaintLabels(true);//  w  w  w .  j  av  a2 s.co  m
        slider.setPaintTicks(true);
        slider.setMajorTickSpacing(10);
        buttonPanel.add(createTransformer(slider));

        buttonPanel.add(createTransformer(new JRadioButton("JRadioButton")));
        final JLabel label = new JLabel("JLabel");
        label.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent e) {
                Font font = label.getFont();
                label.setFont(font.deriveFont(font.getSize2D() + 10));
            }

            public void mouseExited(MouseEvent e) {
                Font font = label.getFont();
                label.setFont(font.deriveFont(font.getSize2D() - 10));
            }
        });
        buttonPanel.add(createTransformer(label));

        return buttonPanel;
    }

From source file:EditorPaneExample20.java

public HTMLInsertFrame(String title, JEditorPane editor) {
    super(title);
    this.pane = editor;

    // Build the layout
    textArea = new JTextArea(10, 32);
    textArea.setLineWrap(true);/*ww  w  .ja v  a2s .c o m*/
    textArea.setWrapStyleWord(true);
    insertButton = new JButton("Insert HTML");
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "HTML Source",
            TitledBorder.CENTER, TitledBorder.TOP));
    topPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);
    JPanel bottomPanel = new JPanel();
    bottomPanel.add(insertButton);

    getContentPane().add(topPanel, BorderLayout.CENTER);
    getContentPane().add(bottomPanel, BorderLayout.SOUTH);

    pane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName().equals("page")) {
                setGUIState();
            }
        }
    });

    insertButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            EditorKit kit = pane.getEditorKit();
            if (kit instanceof HTMLEditorKit) {
                String htmlString = textArea.getText();
                if (htmlString.trim().equals("") == false) {
                    try {
                        ((HTMLEditorKit) kit).read(new StringReader(htmlString), pane.getDocument(),
                                pane.getCaretPosition());
                    } catch (Exception e) {
                    }
                }
            }
        }
    });

    setGUIState(); // Disable if not HTML content
    pack();
}

From source file:org.isatools.isacreator.gui.formelements.SubForm.java

protected void initialisePanel() {
    this.setLayout(new BorderLayout());
    this.setBackground(UIHelper.BG_COLOR);

    if (createBorder) {
        setBorder(new TitledBorder(UIHelper.GREEN_ROUNDED_BORDER, title, TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.CENTER, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR));
    } else {//from ww  w.  ja v a2s  . com
        setBorder(new EmptyBorder(2, 2, 2, 2));
    }
}

From source file:pcgen.gui2.tabs.SummaryInfoTab.java

private static void setPanelTitle(JComponent panel, String title) {
    panel.setBorder(//  w  w  w  .  j  av a 2s  . c  o m
            BorderFactory.createTitledBorder(null, title, TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
}