Example usage for java.awt FlowLayout FlowLayout

List of usage examples for java.awt FlowLayout FlowLayout

Introduction

In this page you can find the example usage for java.awt FlowLayout FlowLayout.

Prototype

public FlowLayout(int align, int hgap, int vgap) 

Source Link

Document

Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.

Usage

From source file:com.antelink.sourcesquare.gui.view.ExitSourceSquareView.java

/**
 * Create the frame./* w  w w.j a va  2  s .  c  om*/
 */
public ExitSourceSquareView() {
    setIconImage(Toolkit.getDefaultToolkit().getImage(SourceSquareView.class.getResource("/antelink.png")));
    setTitle("SourceSquare");
    setResizable(false);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 500, 170);
    this.contentPane = new JPanel();
    this.contentPane.setBackground(Color.WHITE);
    this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(this.contentPane);

    this.mainPanel = new JPanel();
    this.mainPanel.setBackground(Color.WHITE);
    GroupLayout gl_contentPane = new GroupLayout(this.contentPane);
    gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addComponent(this.mainPanel, GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE));
    gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addComponent(this.mainPanel, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE));
    this.mainPanel.setLayout(new BoxLayout(this.mainPanel, BoxLayout.Y_AXIS));

    JPanel panel_1 = new JPanel();
    panel_1.setBackground(Color.WHITE);
    this.mainPanel.add(panel_1);
    panel_1.setLayout(new BorderLayout(0, 0));

    JPanel panel = new JPanel();
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 50, 20));
    panel.setBackground(Color.WHITE);
    panel_1.add(panel, BorderLayout.SOUTH);

    Image openButtonImage = Toolkit.getDefaultToolkit()
            .getImage(SourceSquareView.class.getResource("/OpenButton.png"));
    this.openButtonLabel = new JLabel(new ImageIcon(openButtonImage));
    this.openButtonLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    panel.add(this.openButtonLabel);

    JLabel exitLabel = new JLabel("<html><b>Closing this window will quit the application</b></html>");
    exitLabel.setFont(new Font("Helvetica", Font.PLAIN, 13));

    JLabel explainLabel = new JLabel("<html>(You won't be able to see or publish your results anymore)</html>");
    explainLabel.setFont(new Font("Helvetica", Font.PLAIN, 13));

    JPanel textPanel = new JPanel();
    textPanel.setBackground(Color.WHITE);
    textPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0));

    textPanel.add(exitLabel, BorderLayout.CENTER);
    textPanel.add(explainLabel, BorderLayout.CENTER);

    panel_1.add(textPanel, BorderLayout.CENTER);

    CopyrightPanel copyrightPanel = new CopyrightPanel();
    copyrightPanel.setBackground(Color.WHITE);
    this.mainPanel.add(copyrightPanel);
    this.contentPane.setLayout(gl_contentPane);

    setLocationRelativeTo(null);
}

From source file:cn.edu.tsinghua.gui.HistogramDemo.java

/**
 * Initialize display.//from  w ww . ja  v  a2s. c  o m
 * @author Sun Microsystems
 * @param filename is the image filename
 */
public HistogramDemo(String filename) {
    File f = new File(filename);

    if (f.exists() && f.canRead()) {
        source = JAI.create("fileload", filename);
    } else {
        return;
    }

    canvas = new ImageDisplay(source);
    canvas.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 2));

    panner = new Panner(canvas, source, 128);
    panner.setBackground(Color.red);
    panner.setBorder(new EtchedBorder());
    canvas.add(panner);

    Font font = new Font("SansSerif", Font.BOLD, 12);
    JLabel title = new JLabel(" Histogram");
    title.setFont(font);
    title.setLocation(0, 32);

    setOpaque(true);
    setLayout(new BorderLayout());
    setBackground(Color.white);

    graph = new XYPlot();
    graph.setBackground(Color.black);
    graph.setBorder(new LineBorder(new Color(0, 0, 255), 1));

    Colorbar cbar = new Colorbar();
    cbar.setBackground(Color.black);
    cbar.setPreferredSize(new Dimension(256, 25));
    cbar.setBorder(new LineBorder(new Color(255, 0, 255), 2));

    JPanel hist_panel = new JPanel();
    hist_panel.setLayout(new BorderLayout());
    hist_panel.setBackground(Color.white);
    hist_panel.add(graph, BorderLayout.CENTER);
    hist_panel.add(cbar, BorderLayout.SOUTH);

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(2, 1, 5, 5));
    panel.setBackground(Color.white);
    panel.add(canvas);
    panel.add(hist_panel);

    JPanel controlPanel = new JPanel();
    controlPanel.setLayout(new FlowLayout());

    reset = new JButton("Reset");
    equal = new JButton("Uniform");
    norm = new JButton("Gaussian");
    piece = new JButton("Piecewise");

    reset.addActionListener(this);
    equal.addActionListener(this);
    norm.addActionListener(this);
    piece.addActionListener(this);

    controlPanel.add(reset);
    controlPanel.add(equal);
    controlPanel.add(norm);
    controlPanel.add(piece);

    add(title, BorderLayout.NORTH);
    add(panel, BorderLayout.CENTER);
    add(controlPanel, BorderLayout.SOUTH);

    // original histogram (remains unmodified)
    // graph.plot( getHistogram(source) );
    graph.plot(getMultiHistogram(source));
}

From source file:com.sshtools.common.ui.OptionsPanel.java

/**
 *
 *
 * @param parent//w w w.  ja v  a 2 s  .c  om
 * @param tabs tabs
 *
 * @return
 */
public static boolean showOptionsDialog(Component parent, OptionsTab[] tabs) {
    final OptionsPanel opts = new OptionsPanel(tabs);
    opts.reset();

    JDialog d = null;
    Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);

    if (w instanceof JDialog) {
        d = new JDialog((JDialog) w, "Options", true);
    } else if (w instanceof JFrame) {
        d = new JDialog((JFrame) w, "Options", true);
    } else {
        d = new JDialog((JFrame) null, "Options", true);
    }

    final JDialog dialog = d;

    //  Create the bottom button panel
    final JButton cancel = new JButton("Cancel");
    cancel.setMnemonic('c');
    cancel.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            opts.cancelled = true;
            dialog.setVisible(false);
        }
    });

    final JButton ok = new JButton("Ok");
    ok.setMnemonic('o');
    ok.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            if (opts.validateTabs()) {
                dialog.setVisible(false);
            }
        }
    });
    dialog.getRootPane().setDefaultButton(ok);

    JPanel buttonPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.insets = new Insets(6, 6, 0, 0);
    gbc.weighty = 1.0;
    UIUtil.jGridBagAdd(buttonPanel, ok, gbc, GridBagConstraints.RELATIVE);
    UIUtil.jGridBagAdd(buttonPanel, cancel, gbc, GridBagConstraints.REMAINDER);

    JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    southPanel.add(buttonPanel);

    //
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    mainPanel.add(opts, BorderLayout.CENTER);
    mainPanel.add(southPanel, BorderLayout.SOUTH);

    // Show the dialog
    dialog.getContentPane().setLayout(new GridLayout(1, 1));
    dialog.getContentPane().add(mainPanel);
    dialog.pack();
    dialog.setResizable(true);
    UIUtil.positionComponent(SwingConstants.CENTER, dialog);
    dialog.setVisible(true);

    if (!opts.cancelled) {
        opts.applyTabs();
    }

    return !opts.cancelled;
}

From source file:cc.siara.csv_ml_demo.MultiLevelCSVSwingDemo.java

/**
 * Constructor that adds components to the container, sets layout and opens
 * with window//from   www.ja v a 2 s .c o  m
 * 
 * @param container
 */
public MultiLevelCSVSwingDemo(Container container) {
    if (container == null)
        container = this;
    if (container instanceof JFrame) {
        JFrame frame = (JFrame) container;
        frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        frame.setLocationByPlatform(true);
        frame.setTitle("Demonstration of Multi-level CSV parsing (csv_ml)");
    }
    container.setSize(800, 600);
    container.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 6));
    container.add(lblInput);
    container.add(cbExamples);
    container.add(lblInputSize);
    container.add(tfInputSize);
    container.add(lblDelimiter);
    container.add(cbDelimiter);
    container.add(tfDelimiter);
    container.add(btnAbout);
    container.add(taInputScroll);
    container.add(lblOutput);
    container.add(btnDDLDML);
    container.add(btnJSON);
    container.add(btnXML);
    container.add(btnXPath);
    container.add(tfXPath);
    container.add(cbPretty);
    container.add(taOutputScroll);
    container.add(lblOutputSize);
    container.add(tfOutputSize);
    container.add(btnToCSV);
    container.add(lblJDBCURL);
    container.add(tfDBURL);
    container.add(btnRunDDL);
    container.add(lblID);
    container.add(tfID);
    container.add(btnGetData);
    JTextField tfID = new JTextField("1", 4);
    taInput.setBorder(BorderFactory.createLineBorder(getForeground()));
    taOutput.setBorder(BorderFactory.createLineBorder(getForeground()));
    setInputText();
    cbExamples.addActionListener(this);
    cbDelimiter.addActionListener(this);
    btnAbout.addActionListener(this);
    btnXML.addActionListener(this);
    btnDDLDML.addActionListener(this);
    btnJSON.addActionListener(this);
    btnToCSV.addActionListener(this);
    btnXPath.addActionListener(this);
    btnRunDDL.addActionListener(this);
    btnGetData.addActionListener(this);
    taInput.addKeyListener(new KeyListener() {
        public void keyTyped(KeyEvent arg0) {
            isInputChanged = true;
        }

        public void keyReleased(KeyEvent arg0) {
        }

        public void keyPressed(KeyEvent arg0) {
        }
    });
    tfInputSize.setEditable(false);
    tfOutputSize.setEditable(false);
    setVisible(true);
}

From source file:de.fhbingen.wbs.wpOverview.tabs.AvailabilityGraphGUI.java

/**
 * Creates the panel for the GUI.//from w  ww .ja  v  a 2 s .  c o  m
 * @return The created panel.
 */
protected final JPanel createOptionPanel() {
    General generalStrings = LocalizedStrings.getGeneralStrings();

    JPanel optionPanel = new JPanel();

    buttons = new JToggleButton[4];
    buttons[AvailabilityGraph.DAY] = new JToggleButton(generalStrings.day());
    buttons[AvailabilityGraph.WEEK] = new JToggleButton(generalStrings.week());
    buttons[AvailabilityGraph.MONTH] = new JToggleButton(generalStrings.month());
    buttons[AvailabilityGraph.YEAR] = new JToggleButton(generalStrings.year());
    for (int i = 0; i < buttons.length; i++) {
        optionPanel.add(buttons[i]);
    }
    optionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    btnPrev = new JButton("<");
    optionPanel.add(btnPrev);

    btnNext = new JButton(">");
    optionPanel.add(btnNext);

    btnManualAv = new JToggleButton(
            LocalizedStrings.getButton().show(LocalizedStrings.getWbs().manualAvailabilities()));
    optionPanel.add(btnManualAv);

    return optionPanel;
}

From source file:com.microsoft.alm.plugin.idea.ui.common.tabs.TabFormImpl.java

/**
 * Create the tab view if not already done
 *///from ww  w.ja va2  s .  c  o  m
protected void ensureInitialized() {
    if (!initialized) {
        createCustomView();
        createFilterToolbar();

        //toolbars
        final JPanel toolBarPanel;
        if (ApplicationManager.getApplication() != null) {
            final ActionToolbar prActionsToolbar = createToolbar(createActionsGroup());
            final ActionToolbar feedbackActionsToolbar = createToolbar(createFeedbackGroup());

            // left panel of the top toolbar
            final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding
            final JPanel toolBarPanelLeft = new JPanel(flowLayout);
            toolBarPanelLeft.add(prActionsToolbar.getComponent());
            toolBarPanelLeft.add(searchFilter);

            //entire top toolbar
            toolBarPanel = new JPanel(new BorderLayout());
            toolBarPanel.add(toolBarPanelLeft, BorderLayout.LINE_START);
            toolBarPanel.add(feedbackActionsToolbar.getComponent(), BorderLayout.LINE_END);
        } else {
            //skip setup when called from unit tests
            toolBarPanel = new JPanel();
        }

        //status panel with label and link
        final JPanel statusPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        statusLabel = new JLabel();
        statusLink = new Hyperlink();
        statusLink.setActionCommand(CMD_STATUS_LINK);
        statusPanel.add(statusLabel);
        statusPanel.add(statusLink);

        //tabPanel
        tabPanel = new JPanel(new BorderLayout());
        tabPanel.add(toolBarPanel, BorderLayout.PAGE_START);
        tabPanel.add(scrollPanel, BorderLayout.CENTER);
        tabPanel.add(statusPanel, BorderLayout.PAGE_END);
        this.initialized = true;
    }
}

From source file:at.tuwien.ifs.somtoolbox.apps.viewer.controls.DendogramView.java

/**
 * @param t/*from  www.  j a  v  a2s .  c o m*/
 * @param numClusters2
 */
public void update(ClusteringTree t, int numClusters) {

    frame.setVisible(true);

    frame.getContentPane().removeAll();
    try {
        // create spinner-panel
        clusterPanel = UiUtils.makeBorderedPanel(new FlowLayout(FlowLayout.LEFT, 10, 0), "Clusters");
        spinnerCluster = new JSpinner(new SpinnerNumberModel(1, 1, maxCluster, 1));
        spinnerCluster.setValue(numClusters);
        spinnerCluster.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                if (mMainSpinnerCluster != null) {
                    mMainSpinnerCluster.setValue(((JSpinner) e.getSource()).getValue());
                }
            }
        });
        UiUtils.fillPanel(clusterPanel, new JLabel("#"), spinnerCluster);
        frame.getContentPane().add(clusterPanel, BorderLayout.NORTH);
        // create graph
        VisualizationViewer g = generateGraph(t, numClusters);
        frame.getContentPane().add(g, BorderLayout.CENTER);
        frame.setSize(frame.getWidth() + 1, frame.getHeight() + 1);
        frame.setSize(frame.getWidth() - 1, frame.getHeight() - 1);

    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:com.socrata.datasync.ui.MetadataJobTab.java

public MetadataJobTab(MetadataJob job, JFrame containingFrame) {
    this.metadataJob = job;

    mainFrame = containingFrame;/*ww w . ja  v  a2  s.c  o  m*/

    // build tab panel form
    //jobPanel = new JPanel(new GridLayout(0,2));
    jobPanel = new JPanel(new GridBagLayout());

    // set FlowLayouts
    FlowLayout flowLeft = new FlowLayout(FlowLayout.LEFT, 0, 0);
    FlowLayout flowRight = new FlowLayout(FlowLayout.LEFT, 0, JOB_FIELD_VGAP);

    //Dataset ID Text Field
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("Dataset ID", DATASET_ID_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 0));
    JPanel datasetIDTextFieldContainer = new JPanel(flowRight);
    datasetIDTextField = new JTextField();
    datasetIDTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    datasetIDTextFieldContainer.add(datasetIDTextField);
    jobPanel.add(datasetIDTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 0));

    //Load Metadata Button
    jobPanel.add(new JLabel(""));
    JPanel loadMetadataButtonContainer = new JPanel(flowRight);
    JButton loadMetadataButton = new JButton("Load Current Dataset Metadata");
    loadMetadataButton.addActionListener(new LoadMetadataActionListener());
    loadMetadataButtonContainer.add(loadMetadataButton);
    loadMetadataButtonContainer.add(UIUtility.generateHelpBubble(LOAD_METADATA_TIP_TEXT));
    jobPanel.add(loadMetadataButtonContainer, UIUtility.getGridBagFieldConstraints(1, 1));

    //Title Text Field
    jobPanel.add(UIUtility.generateLabelWithHelpBubble("Title", TITLE_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 2));
    JPanel titleTextFieldContainer = new JPanel(flowRight);
    titleTextField = new JTextField();
    titleTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    titleTextFieldContainer.add(titleTextField);
    jobPanel.add(titleTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 2));

    //Description Text Area
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("Description", DESCRIPTION_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 3));
    JPanel descriptionTextFieldContainer = new JPanel();
    descriptionTextArea = new JTextArea(5, 33);
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setWrapStyleWord(true);
    JScrollPane descriptionScrollPane = new JScrollPane(descriptionTextArea);
    descriptionTextFieldContainer.add(descriptionScrollPane);
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 1;
    constraints.gridy = 3;
    constraints.weightx = 0;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.ipadx = -10; //Not sure why, but text area was getting extra margin so left edge didn't line up with other fields        
    jobPanel.add(descriptionTextFieldContainer, constraints);

    //Category Text Field
    jobPanel.add(UIUtility.generateLabelWithHelpBubble("Category", CATEGORY_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 4));
    JPanel categoryTextFieldContainer = new JPanel(flowRight);
    categoryTextField = new JTextField();
    categoryTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    categoryTextFieldContainer.add(categoryTextField);
    jobPanel.add(categoryTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 4));

    //Tags/Keywords Text Field
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("Tags/Keywords", KEYWORDS_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 5));
    JPanel keywordsTextFieldContainer = new JPanel(flowRight);
    keywordsTextField = new JTextField();
    keywordsTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    keywordsTextFieldContainer.add(keywordsTextField);
    jobPanel.add(keywordsTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 5));

    //License Type Combo Box
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("License Type", LICENSE_TYPE_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 6));
    JPanel licenseTypeContainer = new JPanel(flowRight);
    licenseTypeComboBox = new JComboBox();
    for (LicenseType licenseType : LicenseType.values()) {
        licenseTypeComboBox.addItem(licenseType);
    }
    licenseTypeContainer.add(licenseTypeComboBox);
    jobPanel.add(licenseTypeContainer, UIUtility.getGridBagFieldConstraints(1, 6));

    //Data Provided By Text Field
    jobPanel.add(UIUtility.generateLabelWithHelpBubble("Data Provided By", DATA_PROVIDED_BY_TIP_TEXT,
            HELP_ICON_TOP_PADDING), UIUtility.getGridBagLabelConstraints(0, 7));
    JPanel dataProvidedByTextFieldContainer = new JPanel(flowRight);
    dataProvidedByTextField = new JTextField();
    dataProvidedByTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    dataProvidedByTextFieldContainer.add(dataProvidedByTextField);
    jobPanel.add(dataProvidedByTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 7));

    //Source Link Text Field
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("Source Link", SOURCE_LINK_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 8));
    JPanel sourceLinkTextFieldContainer = new JPanel(flowRight);
    sourceLinkTextField = new JTextField();
    sourceLinkTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    sourceLinkTextFieldContainer.add(sourceLinkTextField);
    jobPanel.add(sourceLinkTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 8));

    //Contact Info Text Field
    jobPanel.add(
            UIUtility.generateLabelWithHelpBubble("Contact Info", CONTACT_INFO_TIP_TEXT, HELP_ICON_TOP_PADDING),
            UIUtility.getGridBagLabelConstraints(0, 9));
    JPanel contactInfoTextFieldContainer = new JPanel(flowRight);
    contactInfoTextField = new JTextField();
    contactInfoTextField.setPreferredSize(new Dimension(JOB_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    contactInfoTextFieldContainer.add(contactInfoTextField);
    jobPanel.add(contactInfoTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 9));

    //Command to execute
    jobPanel.add(UIUtility.generateLabelWithHelpBubble("Command to execute with scheduler",
            RUN_COMMAND_TIP_TEXT, HELP_ICON_TOP_PADDING), UIUtility.getGridBagLabelConstraints(0, 10));
    JPanel runCommandTextFieldContainer = new JPanel(flowRight);
    runCommandTextField = new JTextField(DEFAULT_RUN_JOB_COMMAND);
    runCommandTextField.setPreferredSize(new Dimension(JOB_COMMAND_TEXTFIELD_WIDTH, JOB_TEXTFIELD_HEIGHT));
    runCommandTextField.setEditable(false);
    runCommandTextField.addMouseListener(new JobCommandTextFieldListener());
    runCommandTextFieldContainer.add(runCommandTextField);
    JButton copyJobCommandButton = new JButton("Copy to clipboard");
    copyJobCommandButton.addActionListener(new CopyJobCommandListener());
    runCommandTextFieldContainer.add(copyJobCommandButton);
    jobPanel.add(runCommandTextFieldContainer, UIUtility.getGridBagFieldConstraints(1, 10));

    // Load job data into fields
    populateFieldsFromJobData();

    jobTabTitleLabel = new JLabel(job.getJobFilename());

}

From source file:org.esa.beam.smos.visat.GridPointBtDataChartToolView.java

@Override
protected JComponent createGridPointComponentOptionsComponent() {
    modeCheckers = new JCheckBox[] { new JCheckBox("X", true), new JCheckBox("Y", true),
            new JCheckBox("XY", true), };
    final JPanel optionsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 2, 2));
    for (JCheckBox modeChecker : modeCheckers) {
        modeChecker.addActionListener(new ActionListener() {
            @Override//from   ww w .j  av a  2s  .c o  m
            public void actionPerformed(ActionEvent e) {
                updateGridPointBtDataComponent();
            }
        });
        optionsPanel.add(modeChecker);
    }
    return optionsPanel;
}

From source file:com.microsoft.alm.plugin.idea.common.ui.common.tabs.TabFormImpl.java

/**
 * Create the tab view if not already done
 *//* ww  w.j  ava  2s  . c  o  m*/
protected void ensureInitialized() {
    if (!initialized) {
        createCustomView();
        createFilterToolbar();

        //toolbars
        final JPanel toolBarPanel;
        if (ApplicationManager.getApplication() != null) {
            final ActionToolbar prActionsToolbar = createToolbar(createActionsGroup());
            final ActionToolbar feedbackActionsToolbar = createToolbar(createFeedbackGroup());
            final ActionToolbar optionsActionsToolbar = createToolbar(createOptionsGroup());

            // left panel of the top toolbar
            final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding
            final JPanel toolBarPanelLeft = new JPanel(flowLayout);
            toolBarPanelLeft.add(prActionsToolbar.getComponent());
            toolBarPanelLeft.add(searchFilter);
            addCustomTools(toolBarPanelLeft);

            // middle panel of the top toolbar
            final FlowLayout flowLayout2 = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding
            final JPanel toolBarPanelMiddle = new JPanel(flowLayout2);
            toolBarPanelMiddle.add(optionsActionsToolbar.getComponent());
            SwingHelper.setMargin(toolBarPanelMiddle, new Insets(JBUI.scale(2), JBUI.scale(15), 0, 0));

            //entire top toolbar
            toolBarPanel = new JPanel(new BorderLayout());
            toolBarPanel.add(toolBarPanelLeft, BorderLayout.LINE_START);
            toolBarPanel.add(toolBarPanelMiddle, BorderLayout.CENTER);
            toolBarPanel.add(feedbackActionsToolbar.getComponent(), BorderLayout.LINE_END);
        } else {
            //skip setup when called from unit tests
            toolBarPanel = new JPanel();
        }

        //status panel with label and link
        final JPanel statusPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        statusLabel = new JLabel();
        statusLink = new Hyperlink();
        statusLink.setActionCommand(CMD_STATUS_LINK);
        statusPanel.add(statusLabel);
        statusPanel.add(statusLink);

        //tabPanel
        tabPanel = new JPanel(new BorderLayout());
        tabPanel.add(toolBarPanel, BorderLayout.PAGE_START);
        tabPanel.add(scrollPanel, BorderLayout.CENTER);
        tabPanel.add(statusPanel, BorderLayout.PAGE_END);
        this.initialized = true;
    }
}