Example usage for com.jgoodies.forms.layout ColumnSpec decode

List of usage examples for com.jgoodies.forms.layout ColumnSpec decode

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout ColumnSpec decode.

Prototype

public static ColumnSpec decode(String encodedColumnSpec) 

Source Link

Document

Parses the encoded column specification and returns a ColumnSpec object that represents the string.

Usage

From source file:PluginDetailPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("PluginDetails");
    titleSeparator = new JXTitledSeparator();
    JLabel labelVersion = new JLabel();
    versionLabel = new JLabel();
    JLabel labelAuthor = new JLabel();
    authorLabel = new JLabel();
    JLabel labelServices = new JLabel();
    servicesLabel = new JLabel();
    checkboxPluginIsActive = new JCheckBox();
    checkboxUpdatePlugins = new JCheckBox();
    checkboxClipboardMonitoring = new JCheckBox();
    JLabel labelMaxConnections = new JLabel();
    spinnerMaxPluginConnections = new JSpinner();
    JLabel labelPriority = new JLabel();
    spinnerPluginPriority = new JSpinner();
    btnPriorityUp = new JButton();
    btnPriorityDown = new JButton();
    pluginHyperlink = new JXHyperlink();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setBorder(new EmptyBorder(3, 3, 0, 2));

    //---- titleSeparator ----
    titleSeparator.setTitle(" ");

    //---- labelVersion ----
    labelVersion.setText(bundle.getString("labelVersion.text"));

    //---- versionLabel ----
    versionLabel.setText(bundle.getString("versionLabel.text"));

    //---- labelAuthor ----
    labelAuthor.setText(bundle.getString("labelAuthor.text"));

    //---- authorLabel ----
    authorLabel.setText(bundle.getString("authorLabel.text"));

    //---- labelServices ----
    labelServices.setText(bundle.getString("labelServices.text"));

    //---- servicesLabel ----
    servicesLabel.setText(bundle.getString("servicesLabel.text"));

    //---- checkboxPluginIsActive ----
    checkboxPluginIsActive.setText(bundle.getString("checkboxPluginIsActive.text"));

    //---- checkboxUpdatePlugins ----
    checkboxUpdatePlugins.setText(bundle.getString("checkboxUpdatePlugins.text"));

    //---- checkboxClipboardMonitoring ----
    checkboxClipboardMonitoring.setText(bundle.getString("checkboxClipboardMonitoring.text"));

    //---- labelMaxConnections ----
    labelMaxConnections.setText(bundle.getString("labelMaxConnections.text"));
    labelMaxConnections.setPreferredSize(new Dimension(180, 14));
    labelMaxConnections.setLabelFor(spinnerMaxPluginConnections);

    //---- spinnerMaxPluginConnections ----
    spinnerMaxPluginConnections.setModel(new SpinnerNumberModel(1, 1, null, 1));

    //---- labelPriority ----
    labelPriority.setText(bundle.getString("labelPriority.text"));
    labelPriority.setLabelFor(spinnerPluginPriority);

    //---- spinnerPluginPriority ----
    spinnerPluginPriority.setModel(new SpinnerNumberModel(1, 1, 1000, 1));

    //---- btnPriorityUp ----
    btnPriorityUp.setText(bundle.getString("btnPriorityUp.text"));

    //---- btnPriorityDown ----
    btnPriorityDown.setText(bundle.getString("btnPriorityDown.text"));

    //---- pluginHyperlink ----
    pluginHyperlink.setText(bundle.getString("pluginHyperlink.text"));

    PanelBuilder builder = new PanelBuilder(new FormLayout(
            new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                    ColumnSpec.decode("max(pref;30dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                    FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.MINIMUM, FormSpec.DEFAULT_GROW) },
            new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                    new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }),
            this);
    ((FormLayout) getLayout()).setColumnGroups(new int[][] { { 7, 9 } });

    builder.add(titleSeparator, cc.xywh(1, 1, 11, 1));
    builder.add(labelVersion, cc.xy(1, 3));
    builder.add(versionLabel, cc.xywh(3, 3, 9, 1));
    builder.add(labelAuthor, cc.xy(1, 5));
    builder.add(authorLabel, cc.xywh(3, 5, 9, 1));
    builder.add(labelServices, cc.xy(1, 7));
    builder.add(servicesLabel, cc.xywh(3, 7, 7, 1));
    builder.add(checkboxPluginIsActive, cc.xywh(1, 9, 11, 1));
    builder.add(checkboxUpdatePlugins, cc.xywh(1, 11, 11, 1));
    builder.add(checkboxClipboardMonitoring, cc.xywh(1, 13, 11, 1));
    builder.add(labelMaxConnections, cc.xywh(1, 15, 3, 1));
    builder.add(spinnerMaxPluginConnections, cc.xy(5, 15));
    builder.add(labelPriority, cc.xywh(1, 17, 3, 1));
    builder.add(spinnerPluginPriority, cc.xy(5, 17));
    builder.add(btnPriorityUp, cc.xy(7, 17));
    builder.add(btnPriorityDown, cc.xy(9, 17));
    builder.add(pluginHyperlink, cc.xywh(1, 19, 9, 1));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:DownloadHistoryDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("DownloadHistoryDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    JPanel panel1 = new JPanel();
    combobox = new JComboBox();
    JLabel labelFilter = new JLabel();
    fieldFilter = new JTextField();
    JScrollPane scrollPane2 = new JScrollPane();
    table = new JXTable();
    JXButtonPanel buttonBar = new JXButtonPanel();
    clearHistoryBtn = new JButton();
    okButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {// ww w . j  av  a  2  s .c  om
        dialogPane.setBorder(Borders.DIALOG);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {

            //======== panel1 ========
            {
                panel1.setBorder(new TitledBorder(bundle.getString("panel1.border")));

                //---- labelFilter ----
                labelFilter.setText(bundle.getString("labelFilter.text"));
                labelFilter.setLabelFor(fieldFilter);

                PanelBuilder panel1Builder = new PanelBuilder(new FormLayout(
                        new ColumnSpec[] { ColumnSpec.decode("max(pref;80dlu)"),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(100)),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) },
                        RowSpec.decodeSpecs("default")), panel1);

                panel1Builder.add(combobox, cc.xy(1, 1));
                panel1Builder.add(labelFilter, cc.xy(3, 1));
                panel1Builder.add(fieldFilter, cc.xy(5, 1));
            }

            //======== scrollPane2 ========
            {
                scrollPane2.setViewportView(table);
            }

            PanelBuilder contentPanelBuilder = new PanelBuilder(
                    new FormLayout(ColumnSpec.decodeSpecs("default:grow"),
                            new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                    new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }),
                    contentPanel);

            contentPanelBuilder.add(panel1, cc.xy(1, 1));
            contentPanelBuilder.add(scrollPane2, cc.xy(1, 3));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

            //---- clearHistoryBtn ----
            clearHistoryBtn.setText(bundle.getString("clearHistoryBtn.text"));

            //---- okButton ----
            okButton.setText(bundle.getString("okButton.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)") },
                    RowSpec.decodeSpecs("fill:pref")), buttonBar);

            buttonBarBuilder.add(clearHistoryBtn, cc.xy(1, 1));
            buttonBarBuilder.add(okButton, cc.xy(5, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:UpdateDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("UpdateDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    JScrollPane scrollPane1 = new JScrollPane();
    table = new JXTable();
    JPanel topPanel = new JPanel();
    JLabel labelUpdateServer = new JLabel();
    server = new JLabel();
    labelUpdatesCount = new JLabel();
    JXButtonPanel buttonBar = new JXButtonPanel();
    progressBar = new JProgressBar();
    btnOK = new JButton();
    btnCancel = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {/*  w w  w.j a va  2  s .co m*/
        dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            contentPanel.setLayout(new BorderLayout(4, 4));

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(table);
            }
            contentPanel.add(scrollPane1, BorderLayout.CENTER);

            //======== topPanel ========
            {

                //---- labelUpdateServer ----
                labelUpdateServer.setText(bundle.getString("labelUpdateServer.text"));

                //---- server ----
                server.setText(bundle.getString("server.text"));

                //---- labelUpdatesCount ----
                labelUpdatesCount.setText(bundle.getString("labelUpdatesCount.text"));

                PanelBuilder topPanelBuilder = new PanelBuilder(new FormLayout(
                        new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        RowSpec.decodeSpecs("default")), topPanel);

                topPanelBuilder.add(labelUpdateServer, cc.xy(1, 1));
                topPanelBuilder.add(server, cc.xy(3, 1));
                topPanelBuilder.add(labelUpdatesCount, cc.xy(7, 1));
            }
            contentPanel.add(topPanel, BorderLayout.NORTH);
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_PAD);
            buttonBar.setCyclic(true);

            //---- btnOK ----
            btnOK.setText(bundle.getString("btnOK.text"));

            //---- btnCancel ----
            btnCancel.setText(bundle.getString("btnCancel.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                            FormSpecs.GLUE_COLSPEC, ColumnSpec.decode("max(pref;42dlu)"),
                            FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC },
                    RowSpec.decodeSpecs("pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 4, 6 } });

            buttonBarBuilder.add(progressBar, cc.xy(2, 1));
            buttonBarBuilder.add(btnOK, cc.xy(4, 1));
            buttonBarBuilder.add(btnCancel, cc.xy(6, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:loginscreen.java

License:Open Source License

/**
 * Initialize the contents of the frame.
 *//*from   www  .ja va 2  s  .co  m*/
private void initialize() {
    frmXarena = new JFrame();
    frmXarena.setExtendedState(frmXarena.getExtendedState() | JFrame.MAXIMIZED_BOTH);
    frmXarena.setTitle("X.ARENA");
    frmXarena.getContentPane().setBackground(Color.BLACK);
    //frmXarena.setBounds(0, 0, 1366, 768);
    frmXarena.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frmXarena.getContentPane().setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("left:45px:grow"),
            ColumnSpec.decode("72px"), ColumnSpec.decode("25px"), ColumnSpec.decode("147px:grow"),
            FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
            FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
            FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
            ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
            FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, },
            new RowSpec[] { RowSpec.decode("30px"), RowSpec.decode("15px"), RowSpec.decode("35px"),
                    RowSpec.decode("19px"), RowSpec.decode("35px"), RowSpec.decode("19px"),
                    RowSpec.decode("35px"), RowSpec.decode("25px"), FormFactory.RELATED_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), }));

    JLabel lblXarena = new JLabel("X.ARENA");
    lblXarena.setFont(new Font("Dialog", Font.BOLD, 17));
    lblXarena.setForeground(Color.RED);
    frmXarena.getContentPane().add(lblXarena, "4, 2, center, center");

    JLabel lblUsername = new JLabel("Username");
    lblUsername.setForeground(Color.GREEN);
    frmXarena.getContentPane().add(lblUsername, "2, 4, center, center");

    usernameTextField = new JTextField();
    frmXarena.getContentPane().add(usernameTextField, "4, 4, fill, center");
    usernameTextField.setColumns(10);

    JLabel lblPassword = new JLabel("Password");
    lblPassword.setForeground(Color.GREEN);
    frmXarena.getContentPane().add(lblPassword, "2, 6, center, center");

    passwordTextField = new JPasswordField();
    frmXarena.getContentPane().add(passwordTextField, "4, 6, fill, center");

    JButton btnLogin = new JButton("Login");
    btnLogin.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            SocketClient client = new SocketClient();
            if (client.main(null) == CONNECTION_ESTABILISHED) {
                String username, loginDetails;
                char[] password;

                username = usernameTextField.getText();
                password = passwordTextField.getPassword();

                loginDetails = "LOGIN" + (char) 13 + username + (char) 13 + (new String(password)) + (char) 13;

                if (client.sendLoginDetails(loginDetails) == 1) {
                    JOptionPane.showMessageDialog(frmXarena, "Login successfull!");

                    mainscreen screen = new mainscreen();
                    window.frmXarena.setVisible(false);

                    screen.main(null);
                    System.out.println("here after calling main");

                } else {
                    JOptionPane.showMessageDialog(frmXarena, "Login failed");
                }

            }

        }
    });
    frmXarena.getContentPane().add(btnLogin, "4, 8, center, center");

    JButton btnSignUp = new JButton("Sign Up");
    btnSignUp.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {

            signupscreen sus = new signupscreen();

            sus.main(null);

            window.frmXarena.setVisible(false);
        }
    });
    frmXarena.getContentPane().add(btnSignUp, "4, 10, center, center");

    JTextArea txtrCreatedByAshish = new JTextArea();
    txtrCreatedByAshish.setText(
            " /******************************************************************\n\nFrom the creators of the X BUS RESERVATION SYSTEM\n\nDeveloped using Git as the Version Control System.\nFind the repository at www.github.com/ashmew2/xarena\n\t\n\t====================\n\t       WELCOME TO X.ARENA\n\t====================\n\nX.Arena is a platform for programmers who enjoy programming.\n\nThe currently supported languages are GNU C and C++.\n\nThis is copyright software licensed under GNU Public License v2.\nYou can view the full license at www.gnu.org/licences.\n\n\n*******************************************************************/\n");
    txtrCreatedByAshish.setForeground(Color.RED);
    txtrCreatedByAshish.setBackground(Color.BLACK);
    frmXarena.getContentPane().add(txtrCreatedByAshish, "4, 28, center, fill");
}

From source file:InformationDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("InformationDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    iconLabel = new JLabel();
    pathLabel = new JLabel();
    JLabel labelFrom = new JLabel();
    fieldFrom = new JTextField();
    JLabel labelSize = new JLabel();
    fieldSize = new JTextField();
    JLabel labelDescription = new JLabel();
    JScrollPane scrollPane1 = new JScrollPane();
    descriptionArea = ComponentFactory.getTextArea();
    JPanel optionsPanel = new JPanel();
    JLabel saveToLabel = new JLabel();
    comboPath = new JComboBox();
    btnSelectPath = new JButton();
    progressBar = new JProgressBar();
    JLabel labelRemaining = new JLabel();
    remainingLabel = new JLabel();
    JLabel labelEstimateTime = new JLabel();
    estTimeLabel = new JLabel();
    JLabel labelCurrentSpeed = new JLabel();
    currentSpeedLabel = new JLabel();
    JLabel labelAverageSpeed = new JLabel();
    avgSpeedLabel = new JLabel();
    JXButtonPanel buttonBar = new JXButtonPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {//from   ww w.  j a v a  2  s . c o m
        dialogPane.setBorder(Borders.DIALOG);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {

            //---- iconLabel ----
            iconLabel.setText(bundle.getString("iconLabel.text"));

            //---- pathLabel ----
            pathLabel.setText(bundle.getString("pathLabel.text"));
            pathLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            //---- labelFrom ----
            labelFrom.setText(bundle.getString("labelFrom.text"));

            //---- fieldFrom ----
            fieldFrom.setBorder(null);
            fieldFrom.setOpaque(false);
            fieldFrom.setText(bundle.getString("fieldFrom.text"));

            //---- labelSize ----
            labelSize.setText(bundle.getString("labelSize.text"));

            //---- fieldSize ----
            fieldSize.setBorder(null);
            fieldSize.setOpaque(false);

            //---- labelDescription ----
            labelDescription.setText(bundle.getString("labelDescription.text"));

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(descriptionArea);
            }

            //======== optionsPanel ========
            {

                //---- saveToLabel ----
                saveToLabel.setText(bundle.getString("saveToLabel.text"));
                saveToLabel.setLabelFor(comboPath);

                //---- comboPath ----
                comboPath.setEditable(true);

                //---- btnSelectPath ----
                btnSelectPath.setText(bundle.getString("btnSelectPath.text"));

                PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout(
                        new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        RowSpec.decodeSpecs("default")), optionsPanel);

                optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1));
                optionsPanelBuilder.add(comboPath, cc.xy(3, 1));
                optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1));
            }

            //---- progressBar ----
            progressBar.setFont(new Font("Tahoma", Font.BOLD, 16));

            //---- labelRemaining ----
            labelRemaining.setText(bundle.getString("labelRemaining.text"));

            //---- remainingLabel ----
            remainingLabel.setText(bundle.getString("remainingLabel.text"));
            remainingLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            //---- labelEstimateTime ----
            labelEstimateTime.setText(bundle.getString("labelEstimateTime.text"));

            //---- estTimeLabel ----
            estTimeLabel.setText(bundle.getString("estTimeLabel.text"));
            estTimeLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            //---- labelCurrentSpeed ----
            labelCurrentSpeed.setText(bundle.getString("labelCurrentSpeed.text"));

            //---- currentSpeedLabel ----
            currentSpeedLabel.setText(bundle.getString("currentSpeedLabel.text"));
            currentSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            //---- labelAverageSpeed ----
            labelAverageSpeed.setText(bundle.getString("labelAverageSpeed.text"));

            //---- avgSpeedLabel ----
            avgSpeedLabel.setText(bundle.getString("avgSpeedLabel.text"));
            avgSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            PanelBuilder contentPanelBuilder = new PanelBuilder(
                    new FormLayout(new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") },
                            new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                    new RowSpec(RowSpec.FILL,
                                            Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)),
                                            FormSpec.DEFAULT_GROW),
                                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                    FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("fill:max(pref;20dlu)"),
                                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                    FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }),
                    contentPanel);

            contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5));
            contentPanelBuilder.add(pathLabel, cc.xywh(3, 1, 7, 1));
            contentPanelBuilder.add(labelFrom, cc.xy(3, 3));
            contentPanelBuilder.add(fieldFrom, cc.xywh(5, 3, 5, 1));
            contentPanelBuilder.add(labelSize, cc.xy(3, 5));
            contentPanelBuilder.add(fieldSize, cc.xywh(5, 5, 3, 1));
            contentPanelBuilder.add(labelDescription, cc.xy(1, 7));
            contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 9, 1));
            contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 9, 1));
            contentPanelBuilder.add(progressBar, cc.xywh(1, 13, 9, 1));
            contentPanelBuilder.add(labelRemaining, cc.xy(1, 15));
            contentPanelBuilder.add(remainingLabel, cc.xywh(3, 15, 3, 1));
            contentPanelBuilder.add(labelEstimateTime, cc.xy(7, 15));
            contentPanelBuilder.add(estTimeLabel, cc.xy(9, 15));
            contentPanelBuilder.add(labelCurrentSpeed, cc.xy(1, 17));
            contentPanelBuilder.add(currentSpeedLabel, cc.xywh(3, 17, 3, 1));
            contentPanelBuilder.add(labelAverageSpeed, cc.xy(7, 17));
            contentPanelBuilder.add(avgSpeedLabel, cc.xy(9, 17));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

            //---- okButton ----
            okButton.setText(bundle.getString("okButton.text"));

            //---- cancelButton ----
            cancelButton.setText(bundle.getString("cancelButton.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                    RowSpec.decodeSpecs("fill:pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } });

            buttonBarBuilder.add(okButton, cc.xy(3, 1));
            buttonBarBuilder.add(cancelButton, cc.xy(5, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:MultipleSettingsDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("MultipleSettingsDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    JLabel iconLabel = new JLabel();
    titleLabel = new JLabel();
    JLabel labelSize = new JLabel();
    fieldSize = new JTextField();
    JLabel labelDescription = new JLabel();
    JScrollPane scrollPane1 = new JScrollPane();
    descriptionArea = ComponentFactory.getTextArea();
    JPanel optionsPanel = new JPanel();
    JLabel saveToLabel = new JLabel();
    comboPath = new JComboBox();
    btnSelectPath = new JButton();
    JXButtonPanel buttonBar = new JXButtonPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {// www .  j  a v a2s.  c o m
        dialogPane.setBorder(Borders.DIALOG);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {

            //---- iconLabel ----
            iconLabel.setText(bundle.getString("iconLabel.text"));

            //---- titleLabel ----
            titleLabel.setText(bundle.getString("titleLabel.text"));
            titleLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

            //---- labelSize ----
            labelSize.setText(bundle.getString("labelSize.text"));

            //---- fieldSize ----
            fieldSize.setBorder(null);
            fieldSize.setOpaque(false);
            fieldSize.setEditable(false);

            //---- labelDescription ----
            labelDescription.setText(bundle.getString("labelDescription.text"));

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(descriptionArea);
            }

            //======== optionsPanel ========
            {

                //---- saveToLabel ----
                saveToLabel.setText(bundle.getString("saveToLabel.text"));
                saveToLabel.setLabelFor(comboPath);

                //---- comboPath ----
                comboPath.setEditable(true);

                //---- btnSelectPath ----
                btnSelectPath.setText(bundle.getString("btnSelectPath.text"));

                PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout(
                        new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        RowSpec.decodeSpecs("default")), optionsPanel);

                optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1));
                optionsPanelBuilder.add(comboPath, cc.xy(3, 1));
                optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1));
            }

            PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") },
                    new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.TOP, Sizes.PREFERRED, FormSpec.NO_GROW),
                            FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                            FormSpecs.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.FILL,
                                    Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)),
                                    FormSpec.DEFAULT_GROW),
                            FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }),
                    contentPanel);

            contentPanelBuilder.add(iconLabel,
                    cc.xywh(1, 1, 1, 5, CellConstraints.DEFAULT, CellConstraints.FILL));
            contentPanelBuilder.add(titleLabel, cc.xywh(3, 1, 5, 1));
            contentPanelBuilder.add(labelSize, cc.xy(3, 3));
            contentPanelBuilder.add(fieldSize, cc.xywh(5, 3, 3, 1));
            contentPanelBuilder.add(labelDescription, cc.xy(1, 7));
            contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 7, 1));
            contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 7, 1));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

            //---- okButton ----
            okButton.setText(bundle.getString("okButton.text"));

            //---- cancelButton ----
            cancelButton.setText(bundle.getString("cancelButton.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                    RowSpec.decodeSpecs("fill:pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } });

            buttonBarBuilder.add(okButton, cc.xy(3, 1));
            buttonBarBuilder.add(cancelButton, cc.xy(5, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:UserPreferencesDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("UserPreferencesDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    toolbar = new JButtonBar();
    panelCard = new JPanel();
    JPanel panelGeneral = new JPanel();
    JPanel panelGeneralSettings = new JPanel();
    checkShowIconInSystemTray = new JCheckBox();
    JPanel panelAlarm = new JPanel();
    JPanel panelWhenAlarmGoesOff = new JPanel();
    JPanel panelAlarmDefaults = new JPanel();
    JPanel panelPlugins = new JPanel();
    JTabbedPane pluginTabbedPane = new JTabbedPane();
    JPanel pluginPanelSettings = new JPanel();
    JScrollPane scrollPane1 = new JScrollPane();
    pluginTable = new JXTable();
    JXButtonPanel pluginsButtonPanel = new JXButtonPanel();
    JLabel labelPluginInfo = new JLabel();
    popmenuButton = ComponentFactory.getPopdownButton();
    btnPluginOptions = new JButton();
    JPanel pluginPanelUpdates = new JPanel();
    check4PluginUpdatesAutomatically = new JCheckBox();
    JLabel labelAfterDetectUpdate = new JLabel();
    comboHowToUpdate = new JComboBox();
    checkDownloadNotExistingPlugins = new JCheckBox();
    JLabel labelCheckForUpdateEvery = new JLabel();
    spinnerUpdateHour = new JSpinner();
    JLabel labelHours = new JLabel();
    JLabel labelUpdateFromServer = new JLabel();
    comboPluginServers = new JComboBox();
    btnResetDefaultPluginServer = new JButton();
    JLabel labelManualCheck = new JLabel();
    buttonBar = new JXButtonPanel();
    btnOK = new JButton();
    btnCancel = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setTitle(bundle.getString("this.title"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {/*from  ww  w  .  j a  v a2  s.co m*/
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            contentPanel.setLayout(new BorderLayout());

            //======== toolbar ========
            {
                toolbar.setBorder(LineBorder.createBlackLineBorder());
                toolbar.setLayout(null);
            }
            contentPanel.add(toolbar, BorderLayout.NORTH);

            //======== panelCard ========
            {
                panelCard.setLayout(new CardLayout());

                //======== panelGeneral ========
                {
                    panelGeneral.setBorder(Borders.TABBED_DIALOG);

                    //======== panelGeneralSettings ========
                    {
                        panelGeneralSettings.setBorder(
                                new TitledBorder(null, bundle.getString("panelGeneralSettings.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        //---- checkShowIconInSystemTray ----
                        checkShowIconInSystemTray.setText(bundle.getString("checkShowIconInSystemTray.text"));

                        PanelBuilder panelGeneralSettingsBuilder = new PanelBuilder(new FormLayout(
                                new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                RowSpec.decodeSpecs("default")), panelGeneralSettings);

                        panelGeneralSettingsBuilder.add(checkShowIconInSystemTray, cc.xy(3, 1));
                    }

                    PanelBuilder panelGeneralBuilder = new PanelBuilder(
                            new FormLayout(ColumnSpec.decodeSpecs("default:grow"),
                                    new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW),
                                            FormSpecs.RELATED_GAP_ROWSPEC,
                                            new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) }),
                            panelGeneral);

                    panelGeneralBuilder.add(panelGeneralSettings, cc.xy(1, 1));
                }
                panelCard.add(panelGeneral, "CARD1");

                //======== panelAlarm ========
                {
                    panelAlarm.setBorder(Borders.TABBED_DIALOG);

                    //======== panelWhenAlarmGoesOff ========
                    {
                        panelWhenAlarmGoesOff.setBorder(
                                new TitledBorder(null, bundle.getString("panelWhenAlarmGoesOff.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        PanelBuilder panelWhenAlarmGoesOffBuilder = new PanelBuilder(
                                new FormLayout(new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.DEFAULT_ROWSPEC }),
                                panelWhenAlarmGoesOff);
                        ((FormLayout) panelWhenAlarmGoesOff.getLayout())
                                .setColumnGroups(new int[][] { { 9, 11 } });

                    }

                    //======== panelAlarmDefaults ========
                    {
                        panelAlarmDefaults
                                .setBorder(new TitledBorder(null, bundle.getString("panelAlarmDefaults.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        PanelBuilder panelAlarmDefaultsBuilder = new PanelBuilder(new FormLayout(
                                new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC }),
                                panelAlarmDefaults);

                    }

                    PanelBuilder panelAlarmBuilder = new PanelBuilder(new FormLayout(
                            ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC,
                                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }),
                            panelAlarm);

                    panelAlarmBuilder.add(panelWhenAlarmGoesOff, cc.xy(1, 1));
                    panelAlarmBuilder.add(panelAlarmDefaults, cc.xy(1, 3));
                }
                panelCard.add(panelAlarm, "CARD2");

                //======== panelPlugins ========
                {
                    panelPlugins.setBorder(Borders.TABBED_DIALOG);

                    //======== pluginTabbedPane ========
                    {

                        //======== pluginPanelSettings ========
                        {
                            pluginPanelSettings.setBorder(
                                    new CompoundBorder(new EmptyBorder(4, 4, 4, 4), new EtchedBorder()));
                            pluginPanelSettings.setLayout(new BorderLayout());

                            //======== scrollPane1 ========
                            {
                                scrollPane1.setViewportView(pluginTable);
                            }
                            pluginPanelSettings.add(scrollPane1, BorderLayout.CENTER);

                            //======== pluginsButtonPanel ========
                            {
                                pluginsButtonPanel.setBorder(new EmptyBorder(4, 4, 4, 4));

                                //---- labelPluginInfo ----
                                labelPluginInfo.setText(bundle.getString("labelPluginInfo.text"));

                                //---- popmenuButton ----
                                popmenuButton.setText(bundle.getString("popmenuButton.text"));

                                //---- btnPluginOptions ----
                                btnPluginOptions.setText(bundle.getString("btnPluginOptions.text"));

                                PanelBuilder pluginsButtonPanelBuilder = new PanelBuilder(new FormLayout(
                                        new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT,
                                                        FormSpec.DEFAULT_GROW),
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC,
                                                FormSpecs.DEFAULT_COLSPEC,
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.UNRELATED_GAP_COLSPEC },
                                        RowSpec.decodeSpecs("default")), pluginsButtonPanel);

                                pluginsButtonPanelBuilder.add(labelPluginInfo, cc.xy(3, 1));
                                pluginsButtonPanelBuilder.add(popmenuButton, cc.xy(5, 1));
                                pluginsButtonPanelBuilder.add(btnPluginOptions, cc.xy(7, 1));
                            }
                            pluginPanelSettings.add(pluginsButtonPanel, BorderLayout.SOUTH);
                        }
                        pluginTabbedPane.addTab(bundle.getString("pluginPanelSettings.tab.title"),
                                pluginPanelSettings);

                        //======== pluginPanelUpdates ========
                        {
                            pluginPanelUpdates.setBorder(new CompoundBorder(new EmptyBorder(4, 4, 4, 4),
                                    new TitledBorder(bundle.getString("pluginPanelUpdates.border"))));

                            //---- check4PluginUpdatesAutomatically ----
                            check4PluginUpdatesAutomatically
                                    .setText(bundle.getString("check4PluginUpdatesAutomatically.text"));

                            //---- labelAfterDetectUpdate ----
                            labelAfterDetectUpdate.setText(bundle.getString("labelAfterDetectUpdate.text"));

                            //---- checkDownloadNotExistingPlugins ----
                            checkDownloadNotExistingPlugins
                                    .setText(bundle.getString("checkDownloadNotExistingPlugins.text"));

                            //---- labelCheckForUpdateEvery ----
                            labelCheckForUpdateEvery.setText(bundle.getString("labelCheckForUpdateEvery.text"));

                            //---- labelHours ----
                            labelHours.setText(bundle.getString("labelHours.text"));

                            //---- labelUpdateFromServer ----
                            labelUpdateFromServer.setText(bundle.getString("labelUpdateFromServer.text"));
                            labelUpdateFromServer.setLabelFor(comboPluginServers);

                            //---- comboPluginServers ----
                            comboPluginServers.setEditable(true);

                            //---- btnResetDefaultPluginServer ----
                            btnResetDefaultPluginServer
                                    .setText(bundle.getString("btnResetDefaultPluginServer.text"));

                            //---- labelManualCheck ----
                            labelManualCheck.setText(bundle.getString("labelManualCheck.text"));

                            PanelBuilder pluginPanelUpdatesBuilder = new PanelBuilder(new FormLayout(
                                    new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC,
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            new ColumnSpec(Sizes
                                                    .bounded(Sizes.MINIMUM, Sizes.dluX(30), Sizes.dluX(30))),
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            new ColumnSpec(ColumnSpec.FILL,
                                                    Sizes.bounded(Sizes.DEFAULT, Sizes.dluX(50),
                                                            Sizes.dluX(75)),
                                                    FormSpec.DEFAULT_GROW),
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            FormSpecs.UNRELATED_GAP_COLSPEC },
                                    new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.UNRELATED_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.UNRELATED_GAP_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC }),
                                    pluginPanelUpdates);

                            pluginPanelUpdatesBuilder.add(check4PluginUpdatesAutomatically,
                                    cc.xywh(1, 1, 5, 1));
                            pluginPanelUpdatesBuilder.add(labelAfterDetectUpdate,
                                    cc.xywh(1, 3, 3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(comboHowToUpdate,
                                    cc.xywh(5, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(checkDownloadNotExistingPlugins, cc.xywh(1, 5, 5, 1));
                            pluginPanelUpdatesBuilder.add(labelCheckForUpdateEvery,
                                    cc.xywh(1, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(spinnerUpdateHour, cc.xy(3, 7));
                            pluginPanelUpdatesBuilder.add(labelHours, cc.xy(5, 7));
                            pluginPanelUpdatesBuilder.add(labelUpdateFromServer,
                                    cc.xywh(1, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(comboPluginServers, cc.xywh(3, 9, 3, 1));
                            pluginPanelUpdatesBuilder.add(btnResetDefaultPluginServer, cc.xy(7, 9));
                            pluginPanelUpdatesBuilder.add(labelManualCheck, cc.xywh(1, 13, 7, 1));
                        }
                        pluginTabbedPane.addTab(bundle.getString("pluginPanelUpdates.tab.title"),
                                pluginPanelUpdates);

                    }

                    PanelBuilder panelPluginsBuilder = new PanelBuilder(
                            new FormLayout(ColumnSpec.decodeSpecs("default:grow"),
                                    new RowSpec[] {
                                            new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                            FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("5px") }),
                            panelPlugins);

                    panelPluginsBuilder.add(pluginTabbedPane, cc.xy(1, 1));
                }
                panelCard.add(panelPlugins, "CARD6");
            }
            contentPanel.add(panelCard, BorderLayout.CENTER);
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_PAD);
            buttonBar.setCyclic(true);

            //---- btnOK ----
            btnOK.setText(bundle.getString("btnOK.text"));

            //---- btnCancel ----
            btnCancel.setText(bundle.getString("btnCancel.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, ColumnSpec.decode("max(pref;42dlu)"),
                            FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC },
                    RowSpec.decodeSpecs("pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 2, 4 } });

            buttonBarBuilder.add(btnOK, cc.xy(2, 1));
            buttonBarBuilder.add(btnCancel, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:ar.com.tellapic.sumi.test.CreateNewNodeDialog.java

License:Open Source License

/**
 *///from w  w w. j  a  v a2s .co m
private void initComponents() {
    setModal(true);
    setIconImage(
            Toolkit.getDefaultToolkit().getImage(CreateNewNodeDialog.class.getResource("/icons/user.png")));
    setBounds(100, 100, 441, 318);
    setMinimumSize(new Dimension(450, 300));
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);

    /* Create the form layout */
    layout = new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
            FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC,
            FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, },
            new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, });

    /* Set the form layout in the content pane */
    contentPanel.setLayout(layout);

    /* Create a label to show a tip */
    JLabel lblTipUseBinds = new JLabel(
            "Tip: use binds Ctrl+N and Ctrl+R to add or remove column data respectively.");
    lblTipUseBinds.setFont(new Font("DejaVu Sans", Font.ITALIC, 10));
    lblTipUseBinds
            .setIcon(new ImageIcon(CreateNewNodeDialog.class.getResource("/icons/information-balloon.png")));

    /* Add the label to the view */
    contentPanel.add(lblTipUseBinds, "2, 2, 6, 1");

    /* Create a label for the user field */
    JLabel lblUserName = new JLabel("User name:");

    /* Add the label to the view */
    contentPanel.add(lblUserName, "2, 4, right, default");

    /* Create the user field */
    userField = new JTextField();
    userField.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            newChildButton.setEnabled(userField.getText().length() > 0);
            //            if (node == null) {
            //               node = new GumiNode(userField.getText());
            //               if (parentNode != null)
            //                  parentNode.add(node);
            //            }
            //            else
            //               node.setUserObject(userField.getText());
        }
    });
    userField.setColumns(10);

    /* Add the user field to the view */
    contentPanel.add(userField, "4, 4, fill, default");

    /* Create the button for adding column data */

    /* Add the button to the view */

    /* Create a separator */
    JButton button = new JButton();
    button.setHideActionText(true);
    button.setAction(newDataAction);
    contentPanel.add(button, "8, 4");

    JSeparator separator = new JSeparator();

    /* Add the separator to the view */
    contentPanel.add(separator, "2, 6, 5, 1");

    /* Create the Button Panel */
    JPanel buttonPane = new JPanel();
    getContentPane().add(buttonPane, BorderLayout.SOUTH);
    buttonPane.setLayout(new FormLayout(
            new ColumnSpec[] { ColumnSpec.decode("max(4dlu;pref)"), ColumnSpec.decode("100px"),
                    ColumnSpec.decode("4dlu:grow"), FormFactory.DEFAULT_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.PREF_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC, },
            new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("28px"), }));

    /* Configure the button for adding childs. Sets its state to disabled */
    newChildButton.setAction(newChildAction);
    newChildButton.setEnabled(false);

    /* Add the new child button to the button panel */
    buttonPane.add(newChildButton, "2, 2, left, top");

    /* Create the OK dialog button */
    JButton okButton = new JButton("OK");
    okButton.setAction(okDialogAction);
    okButton.setActionCommand("OK");

    /* Add the OK dialog button to the button panel */
    buttonPane.add(okButton, "4, 2, left, top");

    /* Create the Cancel dialgo button */
    JButton cancelButton = new JButton("Cancel");
    cancelButton.setAction(cancelDialogAction);
    cancelButton.setActionCommand("Cancel");

    /* Add the cancel dialog button to the button panel */
    buttonPane.add(cancelButton, "6, 2, right, top");

    /* Assign keyboards bindings */
    createKeyboardMappings();

    /* Request focus */
    addComponentListener(new ComponentAdapter() {
        public void componentShown(ComponentEvent e) {
            userField.requestFocus();
        }
    });
    setFocusTraversalPolicy(new FocusTraversalOnArray(
            new Component[] { lblUserName, userField, button, buttonPane, okButton, cancelButton }));
    /* Final configurations */
    getRootPane().setDefaultButton(okButton);
    rowOffset = layout.getRowCount();
}

From source file:at.becast.youploader.gui.EditPanel.java

License:Open Source License

private void initComponents() {
    JLabel lblTemplate = new JLabel();
    cmbTemplate = new JComboBox<Item>();
    loadTemplates();// w w  w .  j ava 2  s  . c  om
    cmbTemplate.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            templateCmbChanged(e);
        }
    });
    setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("110px"),
            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:max(51dlu;default):grow"),
            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:max(28dlu;pref):grow"),
            FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("center:max(10dlu;pref):grow"),
            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("right:30px"), ColumnSpec.decode("2dlu"),
            ColumnSpec.decode("right:30px"), ColumnSpec.decode("2dlu"), ColumnSpec.decode("right:30px"), },
            new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), RowSpec.decode("1dlu"),
                    RowSpec.decode("20px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"),
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), }));

    lblTemplate.setText(LANG.getString("EditPanel.Template") + ":");
    add(lblTemplate, "2, 2, right, center");
    add(cmbTemplate, "4, 2, 5, 1, fill, fill");

    JButton btnDeleteTemplate = new JButton("");
    btnDeleteTemplate.setToolTipText(LANG.getString("EditPanel.DeleteTemplate"));
    btnDeleteTemplate.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            deleteTemplate();
        }
    });

    JButton btnNewTemplate = new JButton("");
    btnNewTemplate.setToolTipText(LANG.getString("EditPanel.SaveNewTemplate"));
    btnNewTemplate.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            addTemplate();
        }
    });

    JButton btnSaveTemplate = new JButton("");
    btnSaveTemplate.setToolTipText(LANG.getString("EditPanel.SaveTemplate"));
    btnSaveTemplate.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            saveTemplate();
        }
    });
    btnSaveTemplate.setIcon(new ImageIcon(getClass().getResource("/disk.png")));
    add(btnSaveTemplate, "10, 2, fill, fill");
    btnNewTemplate.setIcon(new ImageIcon(getClass().getResource("/add.png")));
    add(btnNewTemplate, "12, 2, fill, fill");
    btnDeleteTemplate.setIcon(new ImageIcon(getClass().getResource("/cross.png")));
    add(btnDeleteTemplate, "14, 2, fill, fill");

    JLabel lblStartDirectory = new JLabel(LANG.getString("EditPanel.StartDir") + ":");
    add(lblStartDirectory, "2, 4, right, center");

    txtStartDir = new JTextField();
    add(txtStartDir, "4, 4, 5, 1, fill, fill");
    txtStartDir.setColumns(10);

    JButton btnStartDir = new JButton("");
    btnStartDir.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            NativeJFileChooser chooser = new NativeJFileChooser();
            chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int returnVal = chooser.showOpenDialog(getParent());
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                txtStartDir.setText(chooser.getSelectedFile().getAbsolutePath().toString());
            }
        }
    });
    btnStartDir.setIcon(new ImageIcon(getClass().getResource("/folder.png")));
    add(btnStartDir, "10, 4, fill, fill");

    JLabel lblEndDirectory = new JLabel(LANG.getString("EditPanel.EndDir") + ":");
    add(lblEndDirectory, "2, 6, right, center");

    txtEndDir = new JTextField();
    add(txtEndDir, "4, 6, 5, 1, fill, fill");
    txtEndDir.setColumns(10);

    JButton btnEndDir = new JButton("");
    btnEndDir.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            NativeJFileChooser chooser = new NativeJFileChooser();
            chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int returnVal = chooser.showOpenDialog(getParent());
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                txtEndDir.setText(chooser.getSelectedFile().getAbsolutePath().toString());
            }
        }
    });
    btnEndDir.setIcon(new ImageIcon(getClass().getResource("/folder.png")));
    add(btnEndDir, "10, 6, fill, fill");

    JLabel lblVisibility = new JLabel(LANG.getString("EditPanel.Visibility") + ":");
    add(lblVisibility, "2, 8, right, default");

    dateTimePicker = new DateTimePicker(new Date());
    dateTimePicker.setEnabled(false);
    dateTimePicker.getEditor().setEnabled(false);
    Calendar calendar = dateTimePicker.getMonthView().getCalendar();
    // starting today if we are in a hurry
    calendar.setTime(new Date());
    dateTimePicker.getMonthView().setLowerBound(calendar.getTime());

    cmbVisibility = new JComboBox<VisibilityType>();
    cmbVisibility.setModel(new DefaultComboBoxModel<VisibilityType>(VisibilityType.values()));
    add(cmbVisibility, "4, 8, 5, 1, fill, fill");

    JLabel lblReleaseAt = new JLabel(LANG.getString("EditPanel.Relase") + ":");
    add(lblReleaseAt, "2, 10, right, default");

    add(dateTimePicker, "4, 10, 5, 1, fill, fill");

    JLabel lblLicense = new JLabel(LANG.getString("EditPanel.License") + ":");
    add(lblLicense, "2, 12, right, default");

    cmbLicense = new JComboBox<LicenseType>();
    cmbLicense.setModel(new DefaultComboBoxModel<LicenseType>(LicenseType.values()));
    add(cmbLicense, "4, 12, 5, 1, fill, fill");
    cmbLicense.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (cmbLicense.getSelectedItem() == LicenseType.CC) {
                parent.monetisation(true);
            } else {
                parent.monetisation(chckbxAgeRestriction.isSelected());
            }
        }
    });

    JLabel lblThumbnail = new JLabel(LANG.getString("EditPanel.Thumbnail") + ":");
    add(lblThumbnail, "2, 14, right, default");

    txtThumbnail = new JTextField();
    txtThumbnail.setDragEnabled(true);
    txtThumbnail.setDropTarget(new DropTarget() {
        private static final long serialVersionUID = 8809983794742040683L;

        public synchronized void drop(DropTargetDropEvent evt) {
            try {
                evt.acceptDrop(DnDConstants.ACTION_COPY);
                @SuppressWarnings("unchecked")
                List<File> droppedFiles = (List<File>) evt.getTransferable()
                        .getTransferData(DataFlavor.javaFileListFlavor);
                for (File file : droppedFiles) {
                    if (file.getName().endsWith(".jpg") || file.getName().endsWith(".png")
                            || file.getName().endsWith(".jpeg")) {
                        txtThumbnail.setText(file.getAbsolutePath());
                    }
                }
            } catch (Exception ex) {
                LOG.error("Error dropping thumbnail", ex);
            }
        }
    });
    add(txtThumbnail, "4, 14, 5, 1, fill, fill");
    txtThumbnail.setColumns(10);

    JButton btnThumbnail = new JButton("");
    btnThumbnail.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            NativeJFileChooser chooser = new NativeJFileChooser();
            chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            chooser.setFileFilter(new FileNameExtensionFilter("Image Files", "jpg", "jpeg", "png"));
            int returnVal = chooser.showOpenDialog(getParent());
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                txtThumbnail.setText(chooser.getSelectedFile().getAbsolutePath().toString());
            }
        }
    });
    btnThumbnail.setIcon(new ImageIcon(getClass().getResource("/folder.png")));
    add(btnThumbnail, "10, 14, fill, fill");

    JLabel lblStartUploadAt = new JLabel(LANG.getString("EditPanel.StartUpload") + ":");
    add(lblStartUploadAt, "2, 16, right, default");

    dateTimePickerStart = new DateTimePicker(new Date());
    dateTimePickerStart.getMonthView().setLowerBound(calendar.getTime());

    add(dateTimePickerStart, "4, 16, 5, 1, fill, fill");

    JLabel lblGameTitle = new JLabel(LANG.getString("EditPanel.Gametitle") + ":");
    add(lblGameTitle, "2, 18, right, default");

    cmbGameTitle = new AutocompleteComboBox();
    add(cmbGameTitle, "4, 18, 5, 1, fill, fill");

    JLabel lblAdditionalSettings = new JLabel(LANG.getString("EditPanel.OtherSettings") + ":");
    add(lblAdditionalSettings, "2, 20, right, default");

    chckbxAllowEmbedding = new JCheckBox(LANG.getString("EditPanel.embedding"));
    chckbxAllowEmbedding.setToolTipText(LANG.getString("EditPanel.embedding"));
    add(chckbxAllowEmbedding, "4, 20, 3, 1");

    chckbxAgeRestriction = new JCheckBox(LANG.getString("EditPanel.AgeRestriction"));
    chckbxAgeRestriction.setToolTipText(LANG.getString("EditPanel.AgeRestriction"));
    chckbxAgeRestriction.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxAgeRestriction.isSelected()) {
                parent.monetisation(chckbxAgeRestriction.isSelected());
            } else {
                parent.monetisation(cmbLicense.getSelectedItem() == LicenseType.CC);
            }
        }
    });
    add(chckbxAgeRestriction, "8, 20, 3, 1, left, default");

    chckbxMakeStatisticsPublic = new JCheckBox(LANG.getString("EditPanel.Statistics"));
    chckbxMakeStatisticsPublic.setToolTipText(LANG.getString("EditPanel.Statistics"));
    chckbxMakeStatisticsPublic.setVerticalAlignment(SwingConstants.TOP);
    add(chckbxMakeStatisticsPublic, "4, 22, 3, 1, fill, default");

    chckbxAllowComments = new JCheckBox(LANG.getString("EditPanel.AllowComments"));
    chckbxAllowComments.setToolTipText(LANG.getString("EditPanel.AllowComments"));
    chckbxAllowComments.setSelected(true);
    add(chckbxAllowComments, "8, 22, 3, 1, left, default");

    JLabel lblMessage = new JLabel(LANG.getString("EditPanel.Message") + ":");
    add(lblMessage, "2, 24, right, default");

    JScrollPane scrollPane = new JScrollPane();
    add(scrollPane, "4, 24, 5, 7, fill, fill");

    txtMessage = new JTextPane();
    txtMessage.setFont(new Font("SansSerif", Font.PLAIN, 13));
    txtMessage.setEnabled(false);
    scrollPane.setViewportView(txtMessage);
    txtMessage.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            calcNotifies();
        }
    });

    lblSociallenght = new JLabel("(0/110)");
    add(lblSociallenght, "10, 24, 3, 1");

    chckbxGoogle = new JCheckBox("Google+");
    chckbxGoogle.setSelected(true);
    chckbxGoogle.setEnabled(false);
    add(chckbxGoogle, "2, 26, fill, default");

    chckbxTwitter = new JCheckBox("Twitter");
    chckbxTwitter.setSelected(true);
    chckbxTwitter.setEnabled(false);
    add(chckbxTwitter, "2, 28, fill, default");

    chckbxFacebook = new JCheckBox("Facebook");
    chckbxFacebook.setSelected(true);
    chckbxFacebook.setEnabled(false);
    add(chckbxFacebook, "2, 30, fill, default");

    cmbVisibility.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent arg0) {
            if (cmbVisibility.getSelectedItem() == VisibilityType.SCHEDULED) {
                setDateEnabled(true);
                setMessageEnabled(true);
            } else if (cmbVisibility.getSelectedItem() == VisibilityType.PUBLIC) {
                setDateEnabled(false);
                setMessageEnabled(true);
            } else {
                setDateEnabled(false);
                setMessageEnabled(false);
            }
        }
    });
}

From source file:at.becast.youploader.gui.FrmAbout.java

License:Open Source License

/**
 * Create the dialog./*from www . j a va 2 s  .  c o  m*/
 */
public FrmAbout() {
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    setResizable(false);
    setTitle(String.format(LANG.getString("About.title"), Main.APP_NAME));
    ResourceBundle bundle = ResourceBundle.getBundle("build");
    String rev = bundle.getString("git-sha-1");
    String build = bundle.getString("jenkins-build");
    this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/yp.png")));
    setBounds(100, 100, 500, 397);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new FormLayout(
            new ColumnSpec[] { ColumnSpec.decode("max(166dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("210px:grow"), },
            new RowSpec[] { FormSpecs.UNRELATED_GAP_ROWSPEC, RowSpec.decode("20px"),
                    FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC,
                    RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"),
                    FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.PARAGRAPH_GAP_ROWSPEC,
                    RowSpec.decode("103px"), }));

    JLabel label = new JLabel("");
    label.setHorizontalAlignment(SwingConstants.CENTER);
    label.setIcon(new ImageIcon(getClass().getResource("/yp.png")));
    contentPanel.add(label, "1, 2, 1, 9, left, fill");

    JLabel lblYouploader = new JLabel("YouPloader " + Main.VERSION);
    lblYouploader.setFont(new Font("Arial Black", Font.PLAIN, 11));
    contentPanel.add(lblYouploader, "3, 2, left, default");

    JLabel lblGenuineparts = new JLabel("  2016 genuineparts");
    lblGenuineparts.setFont(new Font("Arial Black", Font.PLAIN, 11));
    contentPanel.add(lblGenuineparts, "3, 4, left, default");

    JLabel lblRevision = new JLabel("Revision " + rev);
    lblRevision.setFont(new Font("Arial", Font.PLAIN, 13));
    contentPanel.add(lblRevision, "3, 6");

    JLabel lblBuild = new JLabel("Build " + build);
    lblBuild.setFont(new Font("Arial", Font.PLAIN, 13));
    contentPanel.add(lblBuild, "3, 8");

    JLabel lblHttpsgithubcombecastyouploader = new JLabel("https://github.com/becast/youploader");
    lblHttpsgithubcombecastyouploader.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
            DesktopUtil.openBrowser("https://github.com/becast/youploader");
        }
    });
    lblHttpsgithubcombecastyouploader.setForeground(Color.BLUE);
    lblHttpsgithubcombecastyouploader.setFont(new Font("Arial", Font.PLAIN, 13));
    contentPanel.add(lblHttpsgithubcombecastyouploader, "3, 10");

    JLabel lblCredits = new JLabel("Credits:");
    contentPanel.add(lblCredits, "1, 14");

    JScrollPane scrollPane = new JScrollPane();
    contentPanel.add(scrollPane, "1, 16, 3, 3, fill, fill");

    JTextPane txtCredits = new JTextPane();
    txtCredits.setText(
            "Thanks to everyone who contributed!\r\n\r\nGerman Translation\r\nMeduax - https://github.com/Meduax - https://www.youtube.com/user/Meduax\r\n\r\nTesting:\r\nWePlaydThis\r\n@WePlaydThis\r\nhttps://www.youtube.com/user/WePlaydThis\r\n\r\nTheJessaChannel\r\n@TheJessaChannel\r\nhttps://www.youtube.com/user/TheJessaChannel\r\n\r\nThe kind people of /r/letsplay\r\n");
    txtCredits.setCaretPosition(0);
    txtCredits.setEditable(false);
    scrollPane.setViewportView(txtCredits);
    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
        getContentPane().add(buttonPane, BorderLayout.SOUTH);
        {
            JButton okButton = new JButton("OK");
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    okButton();
                }
            });
            okButton.setActionCommand("OK");
            buttonPane.add(okButton);
            getRootPane().setDefaultButton(okButton);
        }
    }
}