Example usage for javax.swing JLabel setName

List of usage examples for javax.swing JLabel setName

Introduction

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

Prototype

public void setName(String name) 

Source Link

Document

Sets the name of the component to the specified string.

Usage

From source file:Main.java

public static JLabel createSAFLabel(final String name, final JComponent labelForComponent) {
    JLabel label = new JLabel();
    label.setName(name);
    if (labelForComponent != null) {
        label.setLabelFor(labelForComponent);
    }//from   www.ja  va  2 s  . co  m
    return label;
}

From source file:Main.java

public Main() {
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setSize(400, 300);//  w w  w  .  jav  a  2  s .  co m
    jPopupMenu1.add(jMenuItem1);
    jTabbedPane1.addTab(null, jLabel1);
    jTabbedPane1.addTab(null, jLabel2);
    getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
    int tabCount = jTabbedPane1.getTabCount();
    for (int i = 0; i < tabCount; i++) {
        JLabel jLabel = new JLabel("Testing the tab" + (i + 1));
        jTabbedPane1.setTabComponentAt(i, jLabel);
        jLabel.setName(String.valueOf(i));
        jLabel.setComponentPopupMenu(jPopupMenu1);
    }
    jPopupMenu1.addPopupMenuListener(new PopupMenuListener() {

        @Override
        public void popupMenuCanceled(final PopupMenuEvent evt) {
        }

        @Override
        public void popupMenuWillBecomeInvisible(final PopupMenuEvent evt) {
        }

        @Override
        public void popupMenuWillBecomeVisible(final PopupMenuEvent evt) {
            JPopupMenu source = (JPopupMenu) evt.getSource();
            JLabel invoker = (JLabel) source.getInvoker();
            JLabel component = (JLabel) jTabbedPane1.getComponentAt(Integer.parseInt(invoker.getName()));
            jMenuItem1.setText(invoker.getText() + ":  " + component.getText());
        }
    });
}

From source file:au.org.ala.delta.editor.ui.ItemEditor.java

/**
 * Creates the user interface components of this dialog.
 *///from   w ww.  j a  va  2 s.c o  m
private void createUI() {

    JPanel content = new JPanel();
    JLabel lblTaxonNumber = new JLabel("Taxon Number:");
    lblTaxonNumber.setName("taxonNumberLabel");

    spinner = new JSpinner();
    spinner.setModel(new SpinnerNumberModel(1, 1, 1, 1));

    btnSelect = new JToggleButton("Select");
    btnSelect.setName("selectTaxonNumberButton");

    lblEditTaxonName = new JLabel(editTaxonLabelText);

    rtfEditor = new RtfEditor();
    editorScroller = new JScrollPane(rtfEditor);

    chckbxTreatAsVariant = new JCheckBox("Treat as Variant");
    chckbxTreatAsVariant.setName("treatAsVariantCheckbox");

    JPanel panel = new JPanel();

    btnDone = new JButton("Done");
    btnDone.setName("doneEditingTaxonButton");

    taxonSelectionList = new ItemList();

    GroupLayout groupLayout = new GroupLayout(content);
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
                    .createSequentialGroup()
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                            .addGroup(groupLayout.createSequentialGroup()
                                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
                                            .addComponent(spinner).addComponent(lblTaxonNumber,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                                    Short.MAX_VALUE))
                                    .addGap(18).addComponent(btnSelect))
                            .addComponent(chckbxTreatAsVariant))
                    .addGap(23)
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(lblEditTaxonName)
                            .addComponent(editorScroller, GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE)))
                    .addGroup(groupLayout.createSequentialGroup()
                            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                                    .addGroup(groupLayout.createSequentialGroup()
                                            .addGap(0, 759, Short.MAX_VALUE).addComponent(btnDone).addGap(5))
                                    .addComponent(panel, GroupLayout.DEFAULT_SIZE, 850, Short.MAX_VALUE))
                            .addGap(1)))
            .addGap(19)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(lblTaxonNumber)
                    .addComponent(lblEditTaxonName))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addGroup(groupLayout.createSequentialGroup()
                            .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(spinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnSelect))
                            .addPreferredGap(ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                            .addComponent(chckbxTreatAsVariant))
                    .addComponent(editorScroller, GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE))
            .addGap(18).addComponent(panel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addPreferredGap(ComponentPlacement.UNRELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(btnDone)).addGap(17)));
    panel.setLayout(new BorderLayout(0, 0));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    imageDetails = new ImageDetailsPanel();
    imageDetails.setEnabled(false);
    tabbedPane.addTab("Images", imageDetails);
    panel.add(tabbedPane);
    content.setLayout(groupLayout);

    setPreferredSize(new Dimension(827, 500));
    setMinimumSize(new Dimension(748, 444));

    RtfToolBar toolbar = new RtfToolBar(this);
    toolbar.addEditor(rtfEditor);
    getContentPane().add(toolbar, BorderLayout.NORTH);
    getContentPane().add(content, BorderLayout.CENTER);
}

From source file:gdt.jgui.tool.JIconSelector.java

/**
 * Create the context./*  www  .  j  a  v  a  2s  . com*/
 * @param console the main console.
 * @param locator$ the locator string.
 * @return the procedure context.
 */
@Override
public JContext instantiate(JMainConsole console, String locator$) {
    this.console = console;
    try {
        panel.removeAll();
        Properties locator = Locator.toProperties(locator$);
        entihome$ = locator.getProperty(Entigrator.ENTIHOME);
        entityKey$ = locator.getProperty(EntityHandler.ENTITY_KEY);
        entityLabel$ = locator.getProperty(EntityHandler.ENTITY_LABEL);
        requesterResponseLocator$ = locator.getProperty(JRequester.REQUESTER_RESPONSE_LOCATOR);
        //          System.out.println("IconSelector:instantiate:locator="+locator$);
        Entigrator entigrator = console.getEntigrator(entihome$);
        String icons$ = entigrator.ent_getHome(Entigrator.ICONS);
        File icons = new File(icons$);
        File[] fa = icons.listFiles();
        if (fa == null)
            return this;
        ImageIcon icon;
        JLabel label;
        Image img;
        for (File aFa : fa) {
            icon = new ImageIcon(aFa.getPath());
            img = icon.getImage();
            img = img.getScaledInstance(smallIcon, smallIcon, java.awt.Image.SCALE_SMOOTH);
            icon = new ImageIcon(img);
            label = new JLabel();
            label.setIcon(icon);
            label.setName(aFa.getName());
            label.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent me) {
                    try {
                        JLabel label = (JLabel) me.getSource();
                        icon$ = label.getName();
                        byte[] ba = Base64.decodeBase64(requesterResponseLocator$);
                        String responseLocator$ = new String(ba, "UTF-8");
                        responseLocator$ = Locator.append(responseLocator$, ICON, icon$);
                        JConsoleHandler.execute(JIconSelector.this.console, responseLocator$);
                    } catch (Exception ee) {
                        LOGGER.severe(ee.toString());
                    }
                }
            });

            panel.add(label);
        }

    } catch (Exception e) {
        LOGGER.severe(e.toString());
    }
    return this;
}

From source file:au.org.ala.delta.editor.ui.ActionSetsDialog.java

private void createUI() {
    setName("actionSetsDialog");

    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    getContentPane().add(tabbedPane, BorderLayout.CENTER);

    conforTable = new JTable();
    tabbedPane.addTab(_resources.getString("directiveTypeConfor.text"), new JScrollPane(conforTable));

    intkeyTable = new JTable();
    tabbedPane.addTab(_resources.getString("directiveTypeIntkey.text"), new JScrollPane(intkeyTable));

    distTable = new JTable();
    tabbedPane.addTab(_resources.getString("directiveTypeDist.text"), new JScrollPane(distTable));

    keyTable = new JTable();
    tabbedPane.addTab(_resources.getString("directiveTypeKey.text"), new JScrollPane(keyTable));

    JPanel buttonPanel = new JPanel();
    getContentPane().add(buttonPanel, BorderLayout.EAST);

    runButton = new JButton();

    addButton = new JButton();

    editButton = new JButton();

    deleteButton = new JButton();

    doneButton = new JButton();
    GroupLayout gl_buttonPanel = new GroupLayout(buttonPanel);
    gl_buttonPanel.setHorizontalGroup(gl_buttonPanel.createParallelGroup(Alignment.LEADING)
            .addComponent(runButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(addButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(editButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(deleteButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(doneButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    gl_buttonPanel.setVerticalGroup(gl_buttonPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_buttonPanel.createSequentialGroup().addComponent(runButton).addComponent(addButton)
                    .addComponent(editButton).addComponent(deleteButton).addComponent(doneButton)));
    buttonPanel.setLayout(gl_buttonPanel);

    JPanel labelPanel = new JPanel();
    FlowLayout flowLayout = (FlowLayout) labelPanel.getLayout();
    flowLayout.setHgap(20);//w w  w. ja va 2s .  com
    flowLayout.setAlignment(FlowLayout.LEFT);
    getContentPane().add(labelPanel, BorderLayout.NORTH);

    JLabel actionSetLabel = new JLabel();
    actionSetLabel.setName("actionSetsActionSetsLabel");
    labelPanel.add(actionSetLabel);

    actionSetDetailsLabel = new JLabel("");
    labelPanel.add(actionSetDetailsLabel);
}

From source file:au.org.ala.delta.editor.ui.ImageDetailsPanel.java

private void createUI() {
    JPanel panel = new JPanel();

    JPanel buttonPanel = new JPanel();

    JPanel panel_2 = new JPanel();
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 262, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 265, Short.MAX_VALUE)
                    .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
                            .addComponent(buttonPanel, 0, 0, Short.MAX_VALUE)
                            .addComponent(panel_2, 0, 0, Short.MAX_VALUE))
                    .addContainerGap()));

    btnSettings = new JButton();
    btnDisplay = new JButton();
    btnAdd = new JButton();
    btnDelete = new JButton();

    GroupLayout gl_buttonPanel = new GroupLayout(buttonPanel);
    gl_buttonPanel.setHorizontalGroup(gl_buttonPanel.createParallelGroup(Alignment.TRAILING).addGroup(
            Alignment.LEADING,/*from   w  w  w  . ja  v  a2 s . co  m*/
            gl_buttonPanel.createSequentialGroup().addContainerGap().addGroup(gl_buttonPanel
                    .createParallelGroup(Alignment.LEADING)
                    .addComponent(btnSettings, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(btnDisplay, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
                    .addComponent(btnAdd, GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
                    .addComponent(btnDelete, GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_buttonPanel.setVerticalGroup(gl_buttonPanel.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_buttonPanel.createSequentialGroup().addContainerGap(119, Short.MAX_VALUE)
                    .addComponent(btnSettings).addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(btnDisplay).addPreferredGap(ComponentPlacement.RELATED).addComponent(btnAdd)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnDelete).addContainerGap()));
    buttonPanel.setLayout(gl_buttonPanel);

    JLabel lblSubjectText = new JLabel();
    lblSubjectText.setName("imageDetailsSubjectLabel");

    JScrollPane scrollPane_1 = new JScrollPane();

    JLabel lblDevelopersNotes = new JLabel();
    lblDevelopersNotes.setName("imageDetailsDevelopersNotesLabel");

    JScrollPane scrollPane_2 = new JScrollPane();

    JPanel panel_3 = new JPanel();

    String title = _resources.getString("imageDetailsSoundTitle");

    panel_3.setBorder(new TitledBorder(null, title, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    GroupLayout gl_panel_2 = new GroupLayout(panel_2);
    gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_2.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
                            .addComponent(scrollPane_2, GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                            .addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                            .addComponent(lblDevelopersNotes)
                            .addComponent(panel_3, GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                            .addComponent(lblSubjectText))
                    .addContainerGap()));
    gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_2.createSequentialGroup().addContainerGap().addComponent(lblSubjectText)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblDevelopersNotes)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(scrollPane_2, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    developerNotesTextPane = new RtfEditorPane();
    scrollPane_2.setViewportView(developerNotesTextPane);

    subjectTextPane = new RtfEditorPane();
    scrollPane_1.setViewportView(subjectTextPane);

    soundComboBox = new JComboBox();
    soundComboBox.setRenderer(new DefaultListCellRenderer() {
        private static final long serialVersionUID = 1L;

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                boolean cellHasFocus) {
            String text = "";
            ImageOverlay overlay = (ImageOverlay) value;
            if (overlay != null) {
                text = overlay.overlayText;
            }
            super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus);
            return this;
        }
    });

    deleteSoundButton = new JButton();

    playSoundButton = new JButton();

    insertSoundButton = new JButton();
    GroupLayout gl_panel_3 = new GroupLayout(panel_3);
    gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_3.createSequentialGroup().addComponent(soundComboBox, 0, 0, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(deleteSoundButton)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(playSoundButton)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(insertSoundButton)
                    .addContainerGap()));
    gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_3.createSequentialGroup().addContainerGap(5, Short.MAX_VALUE)
                    .addGroup(gl_panel_3.createParallelGroup(Alignment.BASELINE)
                            .addComponent(soundComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(deleteSoundButton).addComponent(playSoundButton)
                            .addComponent(insertSoundButton))));
    panel_3.setLayout(gl_panel_3);

    panel_2.setLayout(gl_panel_2);

    JLabel lblImageFiles = new JLabel();
    lblImageFiles.setName("imageDetailsImageFilesLabel");
    lblImageFiles.setAlignmentY(Component.TOP_ALIGNMENT);

    JScrollPane scrollPane = new JScrollPane();
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup()
                    .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(lblImageFiles)
                            .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap().addComponent(lblImageFiles)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
                    .addContainerGap()));

    imageList = new ImageList();

    scrollPane.setViewportView(imageList);
    panel.setLayout(gl_panel);
    setLayout(groupLayout);
}

From source file:com.mgmtp.perfload.loadprofiles.ui.dialog.SettingsDialog.java

private void initComponents() {
    getContentPane().setLayout(new MigLayout("", "[grow]", "[][grow][grow][grow][]"));
    {/*w  w w  . j a v a 2  s.  co  m*/
        JPanel pnlConfigurations = new JPanel();
        pnlConfigurations.setBorder(new TitledBorder(null, "Saved Configurations", TitledBorder.LEADING,
                TitledBorder.TOP, null, null));
        pnlConfigurations.setName("pnlConfigurations");
        getContentPane().add(pnlConfigurations, "cell 0 0, growx");
        pnlConfigurations.setLayout(new MigLayout("", "[grow]", "[]"));
        {
            JLabel lblFileName = new JLabel("File Name");
            lblFileName.setName("lblFileName");
            pnlConfigurations.add(lblFileName, "flowx,cell 0 0");
        }
        {
            cboConfigurationFile = new JComboBox() {
                @Override
                public void setSelectedItem(final Object anObject) {
                    if (checkDirty()) {
                        super.setSelectedItem(anObject);
                    }
                }
            };
            cboConfigurationFile.addItemListener(new CboConfigurationFileItemListener());
            pnlConfigurations.add(cboConfigurationFile, "cell 0 0,growx");
            cboConfigurationFile.setName("cboConfigurationFile");
        }
        {
            JButton btnNewConfigurationFile = new JButtonExt("New...");
            btnNewConfigurationFile.addActionListener(new BtnNewConfigurationFileActionListener());
            pnlConfigurations.add(btnNewConfigurationFile, "cell 0 0, sg btns");
            btnNewConfigurationFile.setName("btnNewButton");
        }
        {
            JButton btnCopy = new JButtonExt("Copy...");
            btnCopy.addActionListener(new BtnCopyActionListener());
            btnCopy.setName("btnCopy");
            pnlConfigurations.add(btnCopy, "cell 0 0, sg btns");
        }
        {
            JButton btnDelete = new JButtonExt("Delete...");
            btnDelete.addActionListener(new BtnDeleteActionListener());
            btnDelete.setName("btnDelete");
            pnlConfigurations.add(btnDelete, "cell 0 0, sg btns");
        }
    }
    {
        JPanel pnlOperations = new JPanel();
        getContentPane().add(pnlOperations, "cell 0 1, grow");
        pnlOperations.setBorder(
                new TitledBorder(null, "Operations", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        pnlOperations.setName("pnlOperations");
        pnlOperations.setLayout(new MigLayout("insets 4", "[grow][110!]", "[][]"));
        {
            JScrollPane spOperations = new JScrollPane();
            spOperations.setName("spOperations");
            pnlOperations.add(spOperations, "cell 0 0 1 2, height 180::, grow");
            {
                tblOperations = new JTableExt();
                tblOperations.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                tblOperations.setFillsViewportHeight(true);
                tblOperations.setName("tblOperations");
                spOperations.setViewportView(tblOperations);
            }
        }
        {
            JButton btnAddOperation = new JButtonExt("Add Operation");
            btnAddOperation.addActionListener(new BtnAddOperationActionListener());
            btnAddOperation.setMargin(new Insets(2, 2, 2, 2));
            btnAddOperation.setName("btnAddOperation");
            pnlOperations.add(btnAddOperation, "cell 1 0, grow");
        }
        {
            JButton btnRemoveOperation = new JButtonExt("Delete Operation");
            btnRemoveOperation.addActionListener(new BtnRemoveOperationActionListener());
            btnRemoveOperation.setMargin(new Insets(2, 2, 2, 2));
            btnRemoveOperation.setName("btnRemoveOperation");
            pnlOperations.add(btnRemoveOperation, "cell 1 1, growx, top");
        }
    }

    {
        JPanel pnlTargets = new JPanel();
        getContentPane().add(pnlTargets, "cell 0 2, grow");
        pnlTargets.setBorder(
                new TitledBorder(null, "Targets", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        pnlTargets.setName("pnlTargets");
        pnlTargets.setLayout(new MigLayout("insets 4", "[grow][110!]", "[][]"));
        {
            JScrollPane spTargets = new JScrollPane();
            spTargets.setName("spTargets");
            pnlTargets.add(spTargets, "cell 0 0 1 2, height 50::, grow");
            {
                tblTargets = new JTableExt();
                tblTargets.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                tblTargets.setFillsViewportHeight(true);
                tblTargets.setName("tblTargets");
                spTargets.setViewportView(tblTargets);
            }
        }
        {
            JButton btnAddTarget = new JButtonExt("Add Target");
            btnAddTarget.addActionListener(new BtnAddTargetActionListener());
            btnAddTarget.setMargin(new Insets(2, 2, 2, 2));
            btnAddTarget.setName("btnAddClientConfig");
            pnlTargets.add(btnAddTarget, "cell 1 0, growx");
        }
        {
            JButton btnRemoveTarget = new JButtonExt("Delete Target");
            btnRemoveTarget.addActionListener(new BtnRemoveTargetActionListener());
            btnRemoveTarget.setMargin(new Insets(2, 2, 2, 2));
            btnRemoveTarget.setName("btnRemoveClientConfig");
            pnlTargets.add(btnRemoveTarget, "cell 1 1, growx, top");
        }
    }

    {
        JPanel pnlClients = new JPanel();
        getContentPane().add(pnlClients, "cell 0 3, grow");
        pnlClients.setBorder(
                new TitledBorder(null, "Clients", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        pnlClients.setName("pnlClientConfigs");
        pnlClients.setLayout(new MigLayout("insets 4", "[grow][110!]", "[][]"));
        {
            JScrollPane spClients = new JScrollPane();
            spClients.setName("spClients");
            pnlClients.add(spClients, "cell 0 0 1 2, height 50::, grow");
            {
                tblClients = new JTableExt();
                tblClients.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                tblClients.setFillsViewportHeight(true);
                tblClients.setName("tblClients");
                spClients.setViewportView(tblClients);
            }
        }
        {
            JButton btnAddClient = new JButtonExt("Add Client");
            btnAddClient.addActionListener(new BtnAddClientActionListener());
            btnAddClient.setMargin(new Insets(2, 2, 2, 2));
            btnAddClient.setName("btnAddClient");
            pnlClients.add(btnAddClient, "cell 1 0, growx");
        }
        {
            JButton btnRemoveClient = new JButtonExt("Delete Client");
            btnRemoveClient.addActionListener(new BtnRemoveClientActionListener());
            btnRemoveClient.setMargin(new Insets(2, 2, 2, 2));
            btnRemoveClient.setName("btnRemoveClient");
            pnlClients.add(btnRemoveClient, "cell 1 1, growx, top");
        }
    }

    {
        JButton btnOk = new JButtonExt("OK");
        getRootPane().setDefaultButton(btnOk);
        btnOk.addActionListener(new BtnOkActionListener());
        btnOk.setName("btnOk");
        getContentPane().add(btnOk, "cell 0 4,alignx right");
    }
    {
        JButton btnCancel = new JButtonExt("Cancel");
        btnCancel.addActionListener(new BtnCancelActionListener());
        btnCancel.setName("btnCancel");
        getContentPane().add(btnCancel, "cell 0 4,alignx right");
    }
}

From source file:au.org.ala.delta.editor.ui.image.ImageSettingsDialog.java

private void createUI() {
    JPanel overlayDefaultsPanel = new JPanel();
    String overlayDefaultsTitle = _resources.getString("imageSettingsOverlayDefaults.title");
    overlayDefaultsPanel.setBorder(/*w  w w . j  a  v  a  2s  . c  om*/
            new TitledBorder(null, overlayDefaultsTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel imagePathPanel = new JPanel();
    String imagePathTitle = _resources.getString("imageSettingsImagePath.title");
    imagePathPanel.setBorder(
            new TitledBorder(null, imagePathTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel overlayFontDefaultsPanel = new JPanel();
    String overlayFontTitle = _resources.getString("imageSettingsOverlayFonts.title");
    overlayFontDefaultsPanel.setBorder(
            new TitledBorder(null, overlayFontTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addComponent(overlayDefaultsPanel, GroupLayout.PREFERRED_SIZE, 236, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE)
                    .addComponent(overlayFontDefaultsPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE)
                    .addComponent(imagePathPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE))
            .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addGap(10)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
                    .addComponent(overlayDefaultsPanel, 0, 0, Short.MAX_VALUE)
                    .addGroup(groupLayout.createSequentialGroup()
                            .addComponent(imagePathPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(overlayFontDefaultsPanel,
                                    GroupLayout.PREFERRED_SIZE, 260, GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(ComponentPlacement.RELATED).addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    btnOk = new JButton("Ok");
    buttonPanel.add(btnOk);

    btnCancel = new JButton("Cancel");
    buttonPanel.add(btnCancel);

    btnApply = new JButton("Apply");
    btnApply.setHorizontalAlignment(SwingConstants.RIGHT);
    buttonPanel.add(btnApply);

    chckbxCentreInBox = new JCheckBox();
    chckbxCentreInBox.setName("imageSettingsCentreInBox");
    chckbxIncludeComments = new JCheckBox();
    chckbxIncludeComments.setName("imageSettingsIncludeComments");
    chckbxOmitDescription = new JCheckBox();
    chckbxOmitDescription.setName("imageSettingsOmitDescription");
    chckbxUseIntegralHeight = new JCheckBox();
    chckbxUseIntegralHeight.setName("imageSettingsUseIntegralHeight");
    chckbxHotspotsPopUp = new JCheckBox();
    chckbxHotspotsPopUp.setName("imageSettingsHotspotsPopUp");
    chckbxCustomPopupColour = new JCheckBox();
    chckbxCustomPopupColour.setName("imageSettingsCustomPopupColour");
    JPanel panel = new JPanel();

    selectedColourLabel = new JLabel("");
    selectedColourLabel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
    selectedColourLabel.setPreferredSize(new Dimension(25, 25));
    selectedColourLabel.setOpaque(true);
    selectedColourLabel.setEnabled(false);

    chooseColourButton = new JButton();
    chooseColourButton.setEnabled(false);

    JLabel lblButtonAlignment = new JLabel();
    lblButtonAlignment.setName("imageSettingsButtonAlignment");
    buttonAlignmentCombo = new JComboBox();
    buttonAlignmentCombo.setModel(new ButtonAlignmentModel());
    buttonAlignmentCombo.setRenderer(new ButtonAlignmentRenderer());
    GroupLayout gl_overlayDefaultsPanel = new GroupLayout(overlayDefaultsPanel);
    gl_overlayDefaultsPanel.setHorizontalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(6)
                                    .addComponent(lblButtonAlignment))
                            .addComponent(chckbxIncludeComments).addComponent(chckbxOmitDescription)
                            .addComponent(chckbxUseIntegralHeight).addComponent(chckbxHotspotsPopUp)
                            .addComponent(chckbxCustomPopupColour)
                            .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE, 167,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
                            .addComponent(chckbxCentreInBox))
                    .addContainerGap(25, Short.MAX_VALUE)));
    gl_overlayDefaultsPanel
            .setVerticalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(10)
                            .addComponent(chckbxCentreInBox).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxIncludeComments).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxOmitDescription).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxUseIntegralHeight).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxHotspotsPopUp).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxCustomPopupColour).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
                            .addGap(12).addComponent(lblButtonAlignment)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(144, Short.MAX_VALUE)));
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(chooseColourButton).addGap(68)));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(chooseColourButton)
                            .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel.setLayout(gl_panel);
    overlayDefaultsPanel.setLayout(gl_overlayDefaultsPanel);

    JLabel lblFontName = new JLabel();
    lblFontName.setName("imageSettingsFontName");
    JLabel lblSize = new JLabel();
    lblSize.setName("imageSettingsFontSize");
    JLabel lblBold = new JLabel();
    lblBold.setName("imageSettingsFontBold");
    JLabel lblItalic = new JLabel();
    lblItalic.setName("imageSettingsFontItalic");

    JLabel featureLabel = new JLabel();
    featureLabel.setName("imageSettingsFeatureFont");
    buttonFontCombo = new JComboBox();
    buttonFontCombo.setModel(new FontFamilyModel());

    featureSizeCombo = new JComboBox();
    featureSizeCombo.setModel(new FontSizeModel());

    buttonBoldCheckBox = new JCheckBox("");

    featureItalicCheckBox = new JCheckBox("");

    JLabel buttonLabel = new JLabel();
    buttonLabel.setName("imageSettingsButtonFont");

    featureFontCombo = new JComboBox();
    featureFontCombo.setModel(new FontFamilyModel());

    buttonSizeCombo = new JComboBox();
    buttonSizeCombo.setModel(new FontSizeModel());

    featureBoldCheckBox = new JCheckBox("");

    buttonItalicCheckBox = new JCheckBox("");

    JLabel defaultLabel = new JLabel();
    defaultLabel.setName("imageSettingsDefaultFont");
    defaultFontCombo = new JComboBox();
    defaultFontCombo.setModel(new FontFamilyModel());

    defaultSizeCombo = new JComboBox();
    defaultSizeCombo.setModel(new FontSizeModel());

    defaultBoldCheckBox = new JCheckBox("");

    defaultItalicCheckBox = new JCheckBox("");

    JLabel lblSample = new JLabel();
    lblSample.setName("imageSettingsSample");
    sampleTextField = new JTextField("");

    chckbxSaveSampleAs = new JCheckBox();
    chckbxSaveSampleAs.setSelected(true);
    chckbxSaveSampleAs.setName("imageSettingsSaveSampleAs");

    GroupLayout gl_overlayFontDefaultsPanel = new GroupLayout(overlayFontDefaultsPanel);
    gl_overlayFontDefaultsPanel.setHorizontalGroup(gl_overlayFontDefaultsPanel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(defaultLabel).addComponent(featureLabel)
                                            .addComponent(buttonLabel))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_overlayFontDefaultsPanel
                                            .createParallelGroup(Alignment.TRAILING)
                                            .addComponent(lblFontName, 0, 345, Short.MAX_VALUE)
                                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                                    .addGroup(gl_overlayFontDefaultsPanel
                                                            .createParallelGroup(Alignment.TRAILING)
                                                            .addComponent(defaultFontCombo, Alignment.LEADING,
                                                                    0, 339, Short.MAX_VALUE)
                                                            .addComponent(featureFontCombo, 0, 339,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(buttonFontCombo, 0, 339,
                                                                    Short.MAX_VALUE))
                                                    .addPreferredGap(ComponentPlacement.RELATED)))
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblSize, 0, 94, Short.MAX_VALUE)
                                            .addComponent(defaultSizeCombo, 0, 94, Short.MAX_VALUE)
                                            .addComponent(featureSizeCombo, 0, 94, Short.MAX_VALUE)
                                            .addComponent(buttonSizeCombo, 0, 94, Short.MAX_VALUE)))
                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                    .addComponent(lblSample).addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(chckbxSaveSampleAs).addComponent(sampleTextField,
                                                    GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE))))
                    .addGap(18)
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(featureBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(defaultBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(buttonBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBold, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.TRAILING)
                            .addComponent(buttonItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE)
                            .addComponent(featureItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblItalic, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 50,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(defaultItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    gl_overlayFontDefaultsPanel
            .setVerticalGroup(gl_overlayFontDefaultsPanel
                    .createParallelGroup(Alignment.LEADING).addGroup(gl_overlayFontDefaultsPanel
                            .createSequentialGroup().addContainerGap().addGroup(gl_overlayFontDefaultsPanel
                                    .createParallelGroup(Alignment.BASELINE).addComponent(
                                            lblSize)
                                    .addComponent(lblFontName).addComponent(lblItalic).addComponent(lblBold))
                            .addGap(10)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(
                                            Alignment.BASELINE)
                                            .addComponent(defaultFontCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(defaultSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(defaultLabel))
                                    .addComponent(defaultItalicCheckBox).addComponent(defaultBoldCheckBox))
                            .addGap(10)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel
                                            .createParallelGroup(Alignment.BASELINE)
                                            .addComponent(featureFontCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(featureSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(featureLabel))
                                    .addComponent(featureItalicCheckBox).addComponent(featureBoldCheckBox))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                            .addGroup(gl_overlayFontDefaultsPanel
                                                    .createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(buttonSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(buttonFontCombo, GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(buttonLabel))
                                            .addGap(18)
                                            .addGroup(gl_overlayFontDefaultsPanel
                                                    .createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(sampleTextField, GroupLayout.PREFERRED_SIZE,
                                                            40, GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblSample))
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addComponent(chckbxSaveSampleAs))
                                    .addComponent(buttonItalicCheckBox).addComponent(buttonBoldCheckBox))
                            .addContainerGap(16, Short.MAX_VALUE)));
    overlayFontDefaultsPanel.setLayout(gl_overlayFontDefaultsPanel);

    imagePathTextField = new JTextField();
    imagePathTextField.setColumns(10);

    imagePathButton = new JButton("New button");
    GroupLayout gl_imagePathPanel = new GroupLayout(imagePathPanel);
    gl_imagePathPanel.setHorizontalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap()
                    .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(imagePathButton)));
    gl_imagePathPanel.setVerticalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_imagePathPanel.createParallelGroup(Alignment.BASELINE)
                            .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(imagePathButton))
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    imagePathPanel.setLayout(gl_imagePathPanel);
    getContentPane().setLayout(groupLayout);
}

From source file:com.haulmont.cuba.desktop.App.java

protected JComponent createBottomPane() {
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createLineBorder(Color.gray));
    panel.setPreferredSize(new Dimension(0, 20));

    ServerSelector serverSelector = AppBeans.get(ServerSelector.NAME);
    String url = serverSelector.getUrl(serverSelector.initContext());
    if (url == null)
        url = "?";

    final JLabel connectionStateLab = new JLabel(
            messages.formatMainMessage("statusBar.connected", getUserFriendlyConnectionUrl(url)));

    panel.add(connectionStateLab, BorderLayout.WEST);

    JPanel rightPanel = new JPanel();
    BoxLayout rightLayout = new BoxLayout(rightPanel, BoxLayout.LINE_AXIS);
    rightPanel.setLayout(rightLayout);//from  w  w w  .jav  a  2s  . c  om

    UserSession session = connection.getSession();

    JLabel userInfoLabel = new JLabel();
    String userInfo = messages.formatMainMessage("statusBar.user", session.getUser().getName(),
            session.getUser().getLogin());
    userInfoLabel.setText(userInfo);

    rightPanel.add(userInfoLabel);

    JLabel timeZoneLabel = null;
    if (session.getTimeZone() != null) {
        timeZoneLabel = new JLabel();
        String timeZone = messages.formatMainMessage("statusBar.timeZone",
                AppBeans.get(TimeZones.class).getDisplayNameShort(session.getTimeZone()));
        timeZoneLabel.setText(timeZone);

        rightPanel.add(Box.createRigidArea(new Dimension(5, 0)));
        rightPanel.add(timeZoneLabel);
    }

    panel.add(rightPanel, BorderLayout.EAST);

    if (isTestMode()) {
        panel.setName("bottomPane");
        userInfoLabel.setName("userInfoLabel");
        if (timeZoneLabel != null)
            timeZoneLabel.setName("timeZoneLabel");
        connectionStateLab.setName("connectionStateLab");
    }

    return panel;
}

From source file:com.mgmtp.perfload.loadprofiles.ui.AppFrame.java

/**
 * Mostly created by Eclipse WindowBuilder
 *///  ww w .  ja va  2  s . com
private void initComponents() {
    setTitle("perfLoad - Load Profile Configurator");
    setSize(1032, 984);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    SwingUtils.setUIFontStyle(Font.PLAIN);
    {
        JMenuBar menuBar = new JMenuBar();
        menuBar.setName("menuBar");
        setJMenuBar(menuBar);
        initMenuBar(menuBar);
    }

    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(new MigLayout("insets 0", "[grow][]", "[25px][400][grow]"));
    {
        JToolBar toolBar = new JToolBar() {
            @Override
            protected JButton createActionComponent(final Action a) {
                JButton button = super.createActionComponent(a);
                button.setFocusable(false);
                button.setHideActionText(false);
                return button;
            }
        };
        toolBar.setName("toolBar");
        contentPane.add(toolBar, "cell 0 0 2 1,growx,aligny top");
        initToolBar(toolBar);
    }
    {
        JScrollPane spTree = new JScrollPane();
        spTree.setBorder(new CompoundBorder(
                new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Load Profile Elements",
                        TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)),
                new EmptyBorder(4, 4, 4, 4)));
        contentPane.add(spTree, "cell 0 1,grow");
        spTree.setName("spTree");
        {
            tree = new JTree();
            tree.addKeyListener(new TreeKeyListener());
            tree.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
            tree.addTreeSelectionListener(new TreeTreeSelectionListener());
            tree.setShowsRootHandles(true);
            tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
            tree.setName("tree");
            spTree.setViewportView(tree);
        }
    }
    {
        JPanel pnlMain = new JPanel();
        contentPane.add(pnlMain, "cell 1 1");
        pnlMain.setName("pnlMain");
        pnlMain.setLayout(new MigLayout("insets 0", "[664!]", "[grow][]"));
        {
            JPanel pnlLoadProfileProperties = new JPanel();
            pnlLoadProfileProperties.setBorder(new TitledBorder(null, "Load Profile Properties",
                    TitledBorder.LEADING, TitledBorder.TOP, null, null));
            pnlLoadProfileProperties.setName("pnlLoadProfileProperties");
            pnlMain.add(pnlLoadProfileProperties, "flowx,cell 0 0,grow");
            pnlLoadProfileProperties
                    .setLayout(new MigLayout("insets 4", "[270,grow]8[]8[200]8[]8[200]", "[][][][grow]"));
            {
                lblName = new JLabel("Name");
                lblName.setDisplayedMnemonic('N');
                lblName.setHorizontalAlignment(SwingConstants.CENTER);
                lblName.setName("lblName");
                pnlLoadProfileProperties.add(lblName, "cell 0 0");
            }
            {
                JSeparator separator = new JSeparator();
                separator.setPreferredSize(new Dimension(0, 200));
                separator.setOrientation(SwingConstants.VERTICAL);
                separator.setName("separator");
                pnlLoadProfileProperties.add(separator, "cell 1 0 1 4, growy");
            }
            {
                JLabel lblClient = new JLabel("Clients");
                lblClient.setName("lblClient");
                pnlLoadProfileProperties.add(lblClient, "cell 2 0");
            }
            {
                JSeparator separator = new JSeparator();
                separator.setPreferredSize(new Dimension(0, 200));
                separator.setOrientation(SwingConstants.VERTICAL);
                separator.setName("separator");
                pnlLoadProfileProperties.add(separator, "cell 3 0 1 4, growy");
            }
            {
                lblTargets = new JLabel("Targets");
                lblTargets.setName("lblTargets");
                pnlLoadProfileProperties.add(lblTargets, "cell 4 0");
            }
            {
                txtName = new JTextField();
                lblName.setLabelFor(txtName);
                txtName.setColumns(10);
                txtName.setName("txtName");
                txtName.getDocument().addDocumentListener(dirtyListener);
                pnlLoadProfileProperties.add(txtName, "cell 0 1,growx");
            }
            {
                JScrollPane spClients = new JScrollPane();
                spClients.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
                spClients.setName("spClients");
                pnlLoadProfileProperties.add(spClients, "cell 2 1 1 3,grow");
                {
                    tblClients = new JCheckListTable();
                    tblClients.setName("tblClients");
                    spClients.setViewportView(tblClients);
                    spClients.setColumnHeaderView(null);
                }
            }
            {
                JScrollPane spTargets = new JScrollPane();
                spTargets.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
                spTargets.setName("spTargets");
                pnlLoadProfileProperties.add(spTargets, "cell 4 1 1 3,grow");
                {
                    tblTargets = new JCheckListTable();
                    tblTargets.setName("tblTargets");
                    spTargets.setViewportView(tblTargets);
                    spTargets.setColumnHeaderView(null);
                }
            }
            {
                lblDescription = new JLabel("Description");
                lblDescription.setDisplayedMnemonic('D');
                lblDescription.setName("lblDescription");
                pnlLoadProfileProperties.add(lblDescription, "cell 0 2");
            }
            {
                JScrollPane spDescription = new JScrollPane();
                spDescription.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
                spDescription.setName("spDescription");
                pnlLoadProfileProperties.add(spDescription, "cell 0 3,height 50:50:,grow");
                {
                    taDescription = new JTextArea();
                    taDescription.setFont(txtName.getFont());
                    lblDescription.setLabelFor(taDescription);
                    taDescription.setRows(3);
                    taDescription.setName("taDescription");
                    taDescription.getDocument().addDocumentListener(dirtyListener);
                    spDescription.setViewportView(taDescription);
                }
            }
        }
        {
            JPanel pnlCurveAssignment = new JPanel();
            pnlCurveAssignment.setBorder(new TitledBorder(null, "Active Load Curve Assignment",
                    TitledBorder.LEADING, TitledBorder.TOP, null, null));
            pnlMain.add(pnlCurveAssignment, "cell 0 1,grow");
            pnlCurveAssignment.setLayout(new MigLayout("insets 4", "[grow]", "[grow][]"));
            {
                pnlCard = new JPanel();
                pnlCard.setName("pnlCard");
                pnlCurveAssignment.add(pnlCard, "cell 0 0,grow");
                cardLayout = new CardLayout(0, 0);
                pnlCard.setLayout(cardLayout);
                {
                    stairsPanel = new StairsPanel();
                    stairsPanel.setName("stairsPanel");
                    pnlCard.add(stairsPanel, "stairs");
                }
                {
                    oneTimePanel = new OneTimePanel();
                    oneTimePanel.setName("oneTimePanel");
                    pnlCard.add(oneTimePanel, "oneTime");
                }
                {
                    markerPanel = new MarkerPanel();
                    markerPanel.setName("markerPanel");
                    pnlCard.add(markerPanel, "marker");
                }
                {
                    JLabel lblNoActiveCurve = new JLabel("no active curve assignment");
                    lblNoActiveCurve.setHorizontalAlignment(SwingConstants.CENTER);
                    pnlCard.add(lblNoActiveCurve, "none");
                    lblNoActiveCurve.setName("lblNoActiveCurve");
                }
            }
            {
                btnOk = new JButtonExt("OK");
                getRootPane().setDefaultButton(btnOk);
                btnOk.setEnabled(false);
                btnOk.addActionListener(new BtnOkActionListener());
                btnOk.setMnemonic(KeyEvent.VK_O);
                btnOk.setName("btnOk");
                pnlCurveAssignment.add(btnOk, "cell 0 1,alignx right");
            }
            {
                btnCancel = new JButtonExt("Cancel");
                btnCancel.setEnabled(false);
                btnCancel.addActionListener(new BtnCancelActionListener());
                btnCancel.setMnemonic(KeyEvent.VK_C);
                btnCancel.setName("btnCancel");
                pnlCurveAssignment.add(btnCancel, "cell 0 1,alignx right");
            }
        }
    }
}