Example usage for java.awt GridBagConstraints EAST

List of usage examples for java.awt GridBagConstraints EAST

Introduction

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

Prototype

int EAST

To view the source code for java.awt GridBagConstraints EAST.

Click Source Link

Document

Put the component on the right side of its display area, centered vertically.

Usage

From source file:com.limegroup.gnutella.gui.CurrentAudioStatusComponent.java

private void initComponents() {
    Dimension dimension = new Dimension(220, 22);
    setPreferredSize(dimension);/*from  w  ww .j av  a 2  s .co  m*/
    setMinimumSize(dimension);

    speakerIcon = GUIMediator.getThemeImage("speaker");

    text = new JLabel();
    Font f = new Font("DIALOG", Font.BOLD, 10);
    text.setFont(f);
    text.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            if (MediaPlayer.instance().getCurrentSong().getFile() != null
                    || MediaPlayer.instance().getCurrentSong().getPlaylistItem() != null
                    || MediaPlayer.instance().getCurrentSong() instanceof InternetRadioAudioSource
                    || MediaPlayer.instance().getCurrentSong() instanceof DeviceAudioSource) {
                showCurrentSong();
            } else if (MediaPlayer.instance().getCurrentSong() instanceof StreamAudioSource) {
                StreamAudioSource audioSource = (StreamAudioSource) MediaPlayer.instance().getCurrentSong();
                if (audioSource.getDetailsUrl() != null) {
                    GUIMediator.openURL(audioSource.getDetailsUrl());
                }
            } else if (MediaPlayer.instance().getCurrentSong().getURL() != null) {
                GUIMediator.instance().setWindow(GUIMediator.Tabs.LIBRARY);
            }
        }
    });

    shareButton = new MediaButton(I18n.tr("Send this file to a friend"), "share", "share");
    shareButton.addActionListener(new SendToFriendActionListener());
    shareButton.setVisible(false);

    //Share Button
    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = GridBagConstraints.RELATIVE;
    c.insets = new Insets(0, 0, 0, 3);
    add(shareButton, c);//, BorderLayout.LINE_END);

    //Go to Current Audio Control
    c.gridx = 0;
    c.gridx = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.EAST;
    c.insets = new Insets(0, 0, 0, 0);
    add(text, c);//, BorderLayout.LINE_END);
}

From source file:com.att.aro.ui.view.videotab.VideoTab.java

@Override
public JPanel layoutDataPanel() {
    if (mainPanel == null) {

        mainPanel = new JPanel(new GridBagLayout());
        mainPanel.setOpaque(false);//from   w ww  .ja va  2  s .  com

        int section = 1;

        mainPanel.add(buildSummariesGroup(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));

        graphPanelIndex = section++;
        addGraphPanel();

        mainPanel.add(buildManifestsGroup(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(10, 0, 0, 0), 0, 0));

        mainPanel.add(buildRequestsGroup(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(10, 0, 0, 0), 0, 0));
    }
    return mainPanel;
}

From source file:org.vpac.voms.view.swing.VomsesManagementDialog.java

/**
 * This method initializes jPanel/*from  w w w. j av a  2s . com*/
 * 
 * @return javax.swing.JPanel
 */
private JPanel getJPanel() {
    if (jPanel == null) {
        GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
        gridBagConstraints12.gridx = 0;
        gridBagConstraints12.gridwidth = 3;
        gridBagConstraints12.fill = GridBagConstraints.BOTH;
        gridBagConstraints12.gridy = 3;
        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
        gridBagConstraints11.gridx = 1;
        gridBagConstraints11.gridy = 3;
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.gridx = 2;
        gridBagConstraints5.insets = new Insets(0, 0, 15, 15);
        gridBagConstraints5.anchor = GridBagConstraints.EAST;
        gridBagConstraints5.gridy = 2;
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.gridx = 1;
        gridBagConstraints4.insets = new Insets(0, 0, 15, 15);
        gridBagConstraints4.anchor = GridBagConstraints.EAST;
        gridBagConstraints4.weightx = 1.0;
        gridBagConstraints4.gridy = 2;
        GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
        gridBagConstraints31.fill = GridBagConstraints.BOTH;
        gridBagConstraints31.weighty = 1.0;
        gridBagConstraints31.gridx = 1;
        gridBagConstraints31.gridy = 1;
        gridBagConstraints31.insets = new Insets(15, 15, 15, 15);
        gridBagConstraints31.gridwidth = 2;
        gridBagConstraints31.weightx = 1.0;
        GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
        gridBagConstraints21.fill = GridBagConstraints.BOTH;
        gridBagConstraints21.weighty = 1.0;
        gridBagConstraints21.gridx = 0;
        gridBagConstraints21.gridy = 1;
        gridBagConstraints21.insets = new Insets(15, 15, 15, 15);
        gridBagConstraints21.weightx = 1.0;
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.gridx = 1;
        gridBagConstraints3.insets = new Insets(10, 15, 0, 0);
        gridBagConstraints3.anchor = GridBagConstraints.WEST;
        gridBagConstraints3.gridy = 0;
        jLabel1 = new JLabel();
        jLabel1.setText("Active groups");
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.insets = new Insets(10, 15, 0, 0);
        gridBagConstraints2.anchor = GridBagConstraints.WEST;
        gridBagConstraints2.gridy = 0;
        jLabel = new JLabel();
        jLabel.setText("Unused groups:");
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.fill = GridBagConstraints.BOTH;
        gridBagConstraints1.gridy = 1;
        gridBagConstraints1.weightx = 1.0;
        gridBagConstraints1.weighty = 1.0;
        gridBagConstraints1.insets = new Insets(15, 0, 15, 15);
        gridBagConstraints1.gridx = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.fill = GridBagConstraints.BOTH;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new Insets(15, 15, 15, 15);
        gridBagConstraints.gridx = 0;
        jPanel = new JPanel();
        jPanel.setLayout(new GridBagLayout());
        jPanel.add(jLabel, gridBagConstraints2);
        jPanel.add(jLabel1, gridBagConstraints3);
        jPanel.add(getJScrollPane(), gridBagConstraints21);
        jPanel.add(getJScrollPane1(), gridBagConstraints31);
        jPanel.add(getJButton(), gridBagConstraints4);
        jPanel.add(getJButton1(), gridBagConstraints5);
        jPanel.add(getInfoPanel(), gridBagConstraints12);
    }
    return jPanel;
}

From source file:Applet.EmbeddedChart.java

public synchronized void updateInfo(String[] legends, List<double[][]> yVals, boolean gofr) {
    removeAll();//w w  w  .j  a  va2s . c o  m
    GridBagLayout gbl = new GridBagLayout();
    gbl.columnWidths = new int[] { 10, 0, 0 };
    gbl.rowHeights = new int[] { 0, 0, 0 };
    gbl.columnWeights = new double[] { 0.0, 1.0, 1.0 };
    gbl.rowWeights = new double[] { 1.0, 1.0, 0.0 };
    setLayout(gbl);

    this.legends = legends;
    this.yvals = yVals;
    this.gofr = gofr;

    XYDataset dataset = createDataset(gofr, legends, yVals);
    JFreeChart chart = createChart(dataset, title, gofr);
    chartPanel = new ChartPanel(chart);
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.setMaximumDrawWidth(2000);
    chartPanel.setMaximumDrawHeight(2000);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    chartPanel.getChart().setBackgroundPaint(null);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.gridheight = 2;
    gbc.fill = GridBagConstraints.BOTH;
    add(chartPanel, gbc);

    GridBagConstraints gbcX1 = new GridBagConstraints();
    GridBagConstraints gbcX2 = new GridBagConstraints();
    GridBagConstraints gbcY1 = new GridBagConstraints();
    GridBagConstraints gbcY2 = new GridBagConstraints();
    GridBagConstraints gbcButton = new GridBagConstraints();
    final NumberAxis domain = (NumberAxis) ((XYPlot) chartPanel.getChart().getPlot()).getDomainAxis();
    final NumberAxis range = (NumberAxis) ((XYPlot) chartPanel.getChart().getPlot()).getRangeAxis();

    if (gofr) {
        domain.setLowerBound(over.gr_xMin);
        domain.setUpperBound(over.gr_xMax);
        range.setLowerBound(over.gr_yMin);
        range.setUpperBound(over.gr_yMax);
    } else {
        domain.setLowerBound(over.pot_xMin);
        domain.setUpperBound(over.pot_xMax);
        range.setLowerBound(over.pot_yMin);
        range.setUpperBound(over.pot_yMax);
    }

    gbcX2.gridx = 2;
    gbcX2.gridy = 2;
    gbcX2.anchor = GridBagConstraints.EAST;
    gbcX2.insets = new Insets(0, 0, 0, 12);
    final JTextField xMax = new JTextField(5);
    xMax.setMinimumSize(new Dimension(50, 20));
    xMax.setText("" + domain.getUpperBound());
    // gbcX2.fill = GridBagConstraints.VERTICAL;
    add(xMax, gbcX2);
    final boolean gr = gofr;
    xMax.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_xMax = Double.parseDouble(xMax.getText());
                domain.setRange(over.gr_xMin, over.gr_xMax);
            } else {
                over.pot_xMax = Double.parseDouble(xMax.getText());
                domain.setRange(over.pot_xMin, over.pot_xMax);
            }
        }

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

    gbcX1.gridx = 1;
    gbcX1.gridy = 2;
    gbcX1.anchor = GridBagConstraints.WEST;
    gbcX1.insets = new Insets(0, 70, 0, 0);
    final JTextField xMin = new JTextField(5);
    xMin.setMinimumSize(new Dimension(50, 20));
    xMin.setText("" + domain.getLowerBound());
    // gbcX1.fill = GridBagConstraints.VERTICAL;
    add(xMin, gbcX1);
    xMin.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            x1 = Double.parseDouble(xMin.getText());
            domain.setRange(x1, x2);
            if (gr) {
                over.gr_xMin = Double.parseDouble(xMin.getText());
                domain.setRange(over.gr_xMin, over.gr_xMax);
            } else {
                over.pot_xMin = Double.parseDouble(xMin.getText());
                domain.setRange(over.pot_xMin, over.pot_xMax);
            }
        }

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

    gbcY1.gridx = 0;
    gbcY1.gridy = 1;
    gbcY1.anchor = GridBagConstraints.SOUTH;
    gbcY1.insets = new Insets(0, 0, 45, 0);
    final JTextField yMin = new JTextField(5);
    yMin.setMinimumSize(new Dimension(50, 20));
    yMin.setText("" + range.getLowerBound());
    // gbcY1.fill = GridBagConstraints.BOTH;
    add(yMin, gbcY1);
    yMin.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_yMin = Double.parseDouble(yMin.getText());
                range.setRange(over.gr_yMin, over.gr_yMax);
            } else {
                over.pot_yMin = Double.parseDouble(yMin.getText());
                range.setRange(over.pot_yMin, over.pot_yMax);
            }

        }

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

    gbcY2.gridx = 0;
    gbcY2.gridy = 0;
    gbcY2.anchor = GridBagConstraints.NORTH;
    gbcY2.insets = new Insets(10, 0, 0, 0);
    final JTextField yMax = new JTextField(5);
    yMax.setMinimumSize(new Dimension(50, 20));
    yMax.setText("" + range.getUpperBound());
    // gbcY2.fill = GridBagConstraints.BOTH;
    add(yMax, gbcY2);
    yMax.addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            if (gr) {
                over.gr_yMax = Double.parseDouble(yMax.getText());
                range.setRange(over.gr_yMin, over.gr_yMax);
            } else {
                over.pot_yMax = Double.parseDouble(yMax.getText());
                range.setRange(over.pot_yMin, over.pot_yMax);
            }
        }

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

}

From source file:org.pentaho.mondrian.publish.RepositoryLoginDialog.java

private JPanel buildButtonPanel() {
    JPanel buttonPanel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(0, 0, 0, 5);
    c.gridx = 0;//from   www. j  a  va2  s . c  o m
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.EAST;
    c.weightx = 1.0;

    JButton publishButton = new JButton("Publish");
    publishButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (StringUtils.isEmpty(getServerURL()) || StringUtils.isEmpty(getUsername())
                    || StringUtils.isEmpty(getUserPassword())) {
                JOptionPane.showMessageDialog(RepositoryLoginDialog.this,
                        "You must provide a username/password and server URL.", "Error",
                        JOptionPane.ERROR_MESSAGE);
            } else {
                publishPressed = true;
                setVisible(false);
            }
        }

    });

    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            publishPressed = false;
            setVisible(false);
        }

    });

    buttonPanel.add(publishButton, c);
    c.gridx = 1;
    c.weightx = 0;
    c.insets = new Insets(0, 0, 0, 0);
    buttonPanel.add(cancelButton, c);

    return buttonPanel;
}

From source file:org.parosproxy.paros.extension.history.ManualRequestEditorDialog.java

private JPanel getPanelCommand() {
    if (panelCommand == null) {
        jLabel = new JLabel();
        jLabel.setText("");
        panelCommand = new JPanel();
        panelCommand.setLayout(new GridBagLayout());

        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();

        gridBagConstraints2.gridx = 0;/*from   ww w  .j a v a2 s.  c o  m*/
        gridBagConstraints2.gridy = 0;
        gridBagConstraints2.ipadx = 0;
        gridBagConstraints2.ipady = 0;
        gridBagConstraints2.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints2.weightx = 1.0D;
        gridBagConstraints3.gridx = 3;
        gridBagConstraints3.gridy = 0;
        gridBagConstraints3.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints3.insets = new Insets(2, 2, 2, 2);
        gridBagConstraints1.gridx = 2;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints11.anchor = GridBagConstraints.EAST;
        gridBagConstraints11.gridx = 1;
        gridBagConstraints11.gridy = 0;
        gridBagConstraints11.insets = new Insets(0, 0, 0, 0);
        panelCommand.add(jLabel, gridBagConstraints2);
        panelCommand.add(getChkUseTrackingSessionState(), gridBagConstraints11);
        panelCommand.add(getChkFollowRedirect(), gridBagConstraints1);
        panelCommand.add(getBtnSend(), gridBagConstraints3);
    }
    return panelCommand;
}

From source file:savant.ucscexplorer.UCSCExplorerPlugin.java

private void buildUI() {
    topLevelPanel.removeAll();/*www. ja  v  a 2s.c om*/
    topLevelPanel.setLayout(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(5, 5, 5, 5);

    try {
        UCSCDataSourcePlugin ucsc = getUCSCPlugin();
        ucsc.getConnection();
        JLabel cladeLabel = new JLabel("Clade:");
        gbc.anchor = GridBagConstraints.EAST;
        topLevelPanel.add(cladeLabel, gbc);

        cladeCombo = new JComboBox();
        cladeCombo.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                UCSCDataSourcePlugin ucsc = getUCSCPlugin();
                String clade = (String) cladeCombo.getSelectedItem();
                genomeCombo.setModel(new DefaultComboBoxModel(ucsc.getCladeGenomes(clade)));
                genomeCombo.setSelectedItem(ucsc.getCurrentGenome(clade));
            }
        });

        gbc.anchor = GridBagConstraints.WEST;
        topLevelPanel.add(cladeCombo, gbc);

        JLabel genomeLabel = new JLabel("Genome:");
        gbc.anchor = GridBagConstraints.EAST;
        topLevelPanel.add(genomeLabel, gbc);

        genomeCombo = new JComboBox();
        genomeCombo.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                buildProgressUI();
                new GroupsFetcher(getUCSCPlugin(), (GenomeDef) genomeCombo.getSelectedItem()) {
                    @Override
                    public void done(List<GroupDef> groups) {
                        if (groups != null) {
                            GridBagConstraints gbc = new GridBagConstraints();
                            gbc.gridwidth = GridBagConstraints.REMAINDER;
                            gbc.fill = GridBagConstraints.BOTH;
                            gbc.weightx = 1.0;
                            for (GroupDef g : groups) {
                                groupsPanel.add(new GroupPanel(g), gbc);
                            }

                            // Add a filler panel to force everything to the top.
                            gbc.weighty = 1.0;
                            groupsPanel.add(new JPanel(), gbc);
                            loadButton.setEnabled(true);
                            topLevelPanel.validate();
                        }
                    }

                    @Override
                    public void showProgress(double value) {
                        updateProgress(progressMessage, value);
                    }
                }.execute();
            }
        });
        gbc.anchor = GridBagConstraints.WEST;
        topLevelPanel.add(genomeCombo, gbc);

        loadButton = new JButton("Load Selected Tracks");
        loadButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                try {
                    loadSelectedTracks();
                } catch (Throwable x) {
                    DialogUtils.displayException(getTitle(), "Unable to load selected tracks.", x);
                }
            }
        });
        gbc.anchor = GridBagConstraints.EAST;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        topLevelPanel.add(loadButton, gbc);

        groupsPanel = new GroupsPanel();
        groupsPanel.setLayout(new GridBagLayout());

        JScrollPane groupsScroller = new JScrollPane(groupsPanel,
                ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        topLevelPanel.add(groupsScroller, gbc);

        buildProgressUI();

        GenomeUtils.addGenomeChangedListener(new Listener<GenomeChangedEvent>() {
            @Override
            public void handleEvent(GenomeChangedEvent event) {
                UCSCDataSourcePlugin ucsc = getUCSCPlugin();
                ucsc.selectGenomeDB(null);
                GenomeAdapter newGenome = event.getNewGenome();
                GenomeDef g = new GenomeDef(newGenome.getName(), null);
                String newClade = ucsc.findCladeForGenome(g);

                // newClade could be null if the user has opened a genome which has no UCSC equivalent.
                if (newClade != null) {
                    cladeCombo.setSelectedItem(newClade);
                }
            }
        });

        ucsc.selectGenomeDB(null);
        new CladesFetcher(getUCSCPlugin()) {
            @Override
            public void done(String selectedClade) {
                cladeCombo.setModel(new DefaultComboBoxModel(UCSCDataSourcePlugin.STANDARD_CLADES));
                if (selectedClade != null) {
                    cladeCombo.setSelectedItem(selectedClade);
                } else {
                    cladeCombo.setSelectedIndex(0);
                }
            }

            @Override
            public void showProgress(double value) {
                updateProgress(progressMessage, value);
            }
        }.execute();
    } catch (Exception x) {
        LOG.error("Unable to connect to UCSC database.", x);
        topLevelPanel.removeAll();
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.fill = GridBagConstraints.NONE;
        gbc.weightx = 0.0;
        gbc.weighty = 0.0;
        topLevelPanel.add(new JLabel("Unable to connect to UCSC database."), gbc);
        JLabel error = new JLabel(MiscUtils.getMessage(x));
        Font f = topLevelPanel.getFont();
        f = f.deriveFont(Font.ITALIC, f.getSize() - 2.0f);
        error.setFont(f);
        topLevelPanel.add(error, gbc);
    }
}

From source file:edu.harvard.mcz.imagecapture.ChangePasswordDialog.java

/**
 * This method initializes jContentPane/*  w  ww  .  jav a 2s .  c om*/
 * 
 * @return javax.swing.JPanel
 */
private JPanel getJContentPane() {
    if (jContentPane == null) {
        GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
        gridBagConstraints10.gridx = 0;
        gridBagConstraints10.weightx = 0.0;
        gridBagConstraints10.weighty = 1.0;
        gridBagConstraints10.gridy = 6;
        GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
        gridBagConstraints9.gridx = 0;
        gridBagConstraints9.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints9.gridwidth = 2;
        gridBagConstraints9.gridy = 4;
        jLabelResponse = new JLabel();
        jLabelResponse.setText("");
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.fill = GridBagConstraints.BOTH;
        gridBagConstraints8.gridy = 3;
        gridBagConstraints8.weightx = 1.0;
        gridBagConstraints8.anchor = GridBagConstraints.WEST;
        gridBagConstraints8.gridx = 1;
        GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
        gridBagConstraints7.fill = GridBagConstraints.BOTH;
        gridBagConstraints7.gridy = 2;
        gridBagConstraints7.weightx = 1.0;
        gridBagConstraints7.anchor = GridBagConstraints.WEST;
        gridBagConstraints7.gridx = 1;
        GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
        gridBagConstraints6.fill = GridBagConstraints.BOTH;
        gridBagConstraints6.gridy = 1;
        gridBagConstraints6.weightx = 1.0;
        gridBagConstraints6.anchor = GridBagConstraints.WEST;
        gridBagConstraints6.gridx = 1;
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.gridx = 0;
        gridBagConstraints5.anchor = GridBagConstraints.EAST;
        gridBagConstraints5.gridy = 5;
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.gridx = 1;
        gridBagConstraints4.anchor = GridBagConstraints.CENTER;
        gridBagConstraints4.gridy = 5;
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.gridx = 0;
        gridBagConstraints3.anchor = GridBagConstraints.EAST;
        gridBagConstraints3.gridy = 3;
        jLabel3 = new JLabel();
        jLabel3.setText("New Password Again");
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.anchor = GridBagConstraints.EAST;
        gridBagConstraints2.gridy = 2;
        jLabel2 = new JLabel();
        jLabel2.setText("New Password");
        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
        gridBagConstraints11.gridx = 0;
        gridBagConstraints11.anchor = GridBagConstraints.EAST;
        gridBagConstraints11.gridy = 1;
        jLabel1 = new JLabel();
        jLabel1.setText("Old Password");
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.fill = GridBagConstraints.BOTH;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.weightx = 1.0;
        gridBagConstraints1.anchor = GridBagConstraints.WEST;
        gridBagConstraints1.gridx = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.anchor = GridBagConstraints.EAST;
        gridBagConstraints.gridy = 0;
        jLabel = new JLabel();
        jLabel.setText("Change Password For:");
        jContentPane = new JPanel();
        jContentPane.setLayout(new GridBagLayout());
        jContentPane.add(jLabel, gridBagConstraints);
        jContentPane.add(getJTextField(), gridBagConstraints1);
        jContentPane.add(jLabel1, gridBagConstraints11);
        jContentPane.add(jLabel2, gridBagConstraints2);
        jContentPane.add(jLabel3, gridBagConstraints3);
        jContentPane.add(getJButton(), gridBagConstraints4);
        jContentPane.add(getJButton1(), gridBagConstraints5);
        jContentPane.add(getJPasswordFieldOld(), gridBagConstraints6);
        jContentPane.add(getJPasswordField1(), gridBagConstraints7);
        jContentPane.add(getJPasswordField2(), gridBagConstraints8);
        jContentPane.add(jLabelResponse, gridBagConstraints9);
        jContentPane.add(getJPanel(), gridBagConstraints10);
    }
    return jContentPane;
}

From source file:gov.loc.repository.bagger.ui.NewBagFrame.java

private void layoutBagVersionSelection(JPanel contentPane, int row) {
    //contents// w w  w . j ava  2 s . c om
    // Bag version dropdown list
    JLabel bagVersionLabel = new JLabel(bagView.getPropertyMessage("bag.label.version"));
    bagVersionLabel.setToolTipText(bagView.getPropertyMessage("bag.versionlist.help"));
    ArrayList<String> versionModel = new ArrayList<String>();
    Version[] vals = Version.values();
    for (int i = 0; i < vals.length; i++) {
        versionModel.add(vals[i].versionString);
    }

    bagVersionList = new JComboBox(versionModel.toArray());
    bagVersionList.setName(bagView.getPropertyMessage("bag.label.versionlist"));
    bagVersionList.setSelectedItem(Version.V0_96.versionString);
    bagVersionList.setToolTipText(bagView.getPropertyMessage("bag.versionlist.help"));

    GridBagConstraints glbc = null;

    JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(bagVersionLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(bagVersionList, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);
}

From source file:savant.ucsc.UCSCNavigationDialog.java

/** This method is called from within the constructor to
 * initialize the form.//from   w  w  w  .  j  a  v a2 s  . c  o  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    javax.swing.JButton okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    javax.swing.JPanel navigationPanel = new javax.swing.JPanel();
    javax.swing.JLabel cladeLabel = new javax.swing.JLabel();
    cladeCombo = new javax.swing.JComboBox();
    javax.swing.JLabel genomeLabel = new javax.swing.JLabel();
    genomeCombo = new javax.swing.JComboBox();
    javax.swing.JLabel groupLabel = new javax.swing.JLabel();
    groupCombo = new javax.swing.JComboBox();
    javax.swing.JLabel trackLabel = new javax.swing.JLabel();
    trackCombo = new javax.swing.JComboBox();
    javax.swing.JLabel formatLabelLabel = new javax.swing.JLabel();
    formatLabel = new javax.swing.JLabel();
    formatCombo = new javax.swing.JComboBox();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("UCSC Genome Database");
    getContentPane().setLayout(new java.awt.GridBagLayout());

    okButton.setText("OK");
    okButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    getContentPane().add(okButton, gridBagConstraints);

    cancelButton.setText("Cancel");
    cancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    getContentPane().add(cancelButton, gridBagConstraints);

    navigationPanel.setLayout(new java.awt.GridBagLayout());

    cladeLabel.setText("Clade:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(cladeLabel, gridBagConstraints);

    cladeCombo.setMaximumSize(new java.awt.Dimension(300, 32767));
    cladeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cladeComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    navigationPanel.add(cladeCombo, gridBagConstraints);

    genomeLabel.setText("Genome:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(genomeLabel, gridBagConstraints);

    genomeCombo.setMaximumSize(new java.awt.Dimension(300, 32767));
    genomeCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            genomeComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    navigationPanel.add(genomeCombo, gridBagConstraints);

    groupLabel.setText("Group:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(groupLabel, gridBagConstraints);

    groupCombo.setMaximumRowCount(9);
    groupCombo.setMaximumSize(new java.awt.Dimension(300, 32767));
    groupCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            groupComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    navigationPanel.add(groupCombo, gridBagConstraints);

    trackLabel.setText("Track:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(trackLabel, gridBagConstraints);

    trackCombo.setMaximumSize(new java.awt.Dimension(300, 32767));
    trackCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            trackComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    navigationPanel.add(trackCombo, gridBagConstraints);

    formatLabelLabel.setText("Format:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(formatLabelLabel, gridBagConstraints);

    formatLabel.setText("BED");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    navigationPanel.add(formatLabel, gridBagConstraints);

    formatCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            formatComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    navigationPanel.add(formatCombo, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 8, 8);
    getContentPane().add(navigationPanel, gridBagConstraints);

    pack();
}