Example usage for java.awt GridBagConstraints BOTH

List of usage examples for java.awt GridBagConstraints BOTH

Introduction

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

Prototype

int BOTH

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

Click Source Link

Document

Resize the component both horizontally and vertically.

Usage

From source file:org.eurocarbdb.application.glycoworkbench.plugin.s3.gui.LoginLocalFolderPanel.java

private void initGui() {
    // Textual information.
    String descriptionText = "<html><center>"
            + "Your AWS Credentials are stored in encrypted files in a folder on "
            + "your computer. Each stored login has a nickname."
            + "<br><font size=\"-2\">You need to store your AWS credentials before you can use this login method.</font>"
            + "</center></html>";
    String folderTooltipText = "The folder containing your AWS Credentials";
    String browseButtonText = "Change Folder";
    String accountNicknameText = "Stored logins";
    String accountNicknameTooltipText = "Nicknames of the login credentials you have stored";
    String passwordLabelText = "Password";
    String passwordTooltipText = "The password that protects your encrypted file. "
            + "This password may be left empty if you are sure your computer cannot be compromised";

    // Components.
    JHtmlLabel descriptionLabel = new JHtmlLabel(descriptionText, hyperlinkListener);
    descriptionLabel.setHorizontalAlignment(JLabel.CENTER);
    folderPathTextField = new JTextField(this.cockpitHomeFolder.getAbsolutePath());
    folderPathTextField.setEnabled(false);
    folderPathTextField.setToolTipText(folderTooltipText);
    JButton browseButton = new JButton(browseButtonText);
    browseButton.addActionListener(this);
    JHtmlLabel accountNicknamesLabel = new JHtmlLabel(accountNicknameText, hyperlinkListener);
    nicknamesTableModel = new AWSCredentialsFileTableModel();
    accountNicknameTable = new JTable(nicknamesTableModel);
    accountNicknameTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    accountNicknameTable.setShowHorizontalLines(true);
    accountNicknameTable.getTableHeader().setVisible(false);
    JScrollPane accountNicknamesScrollPane = new JScrollPane(accountNicknameTable);
    accountNicknamesScrollPane.setToolTipText(accountNicknameTooltipText);
    JHtmlLabel passwordLabel = new JHtmlLabel(passwordLabelText, hyperlinkListener);
    passwordPasswordField = new JPasswordField();
    passwordPasswordField.setToolTipText(passwordTooltipText);

    int row = 0;//from ww  w. j  a  v  a2s.  com
    add(descriptionLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(folderPathTextField, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(browseButton, new GridBagConstraints(1, row++, 1, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.NONE, insetsDefault, 0, 0));
    add(accountNicknamesLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(accountNicknamesScrollPane, new GridBagConstraints(0, row++, 2, 1, 0, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(passwordLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(passwordPasswordField, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
}

From source file:com.sec.ose.osi.ui.frm.main.identification.autoidentify.JPanImportSPDX.java

private void updateImportSPDXList() {
    getJPanelImportSPDX().removeAll();//from  ww  w .  ja  v a 2  s .  c  om
    int index = 0;
    for (index = 0; index < getJPanSPDXLocationList().size(); index++) {
        JPanLocation tmpLocation = getJPanSPDXLocationList().get(index);
        if (tmpLocation != null) {
            GridBagConstraints tmpGridBagConstraints = new GridBagConstraints();
            tmpGridBagConstraints.insets = new Insets(5, 5, 0, 5); //Insets(int top, int left, int bottom, int right) 
            tmpGridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
            tmpGridBagConstraints.gridx = 0;
            tmpGridBagConstraints.gridy = index;

            getJPanelImportSPDX().add(tmpLocation, tmpGridBagConstraints);
        }
    }

    GridBagConstraints tmpGridBagConstraints = new GridBagConstraints();
    tmpGridBagConstraints.fill = GridBagConstraints.BOTH;
    tmpGridBagConstraints.gridx = 0;
    tmpGridBagConstraints.gridy = index;
    tmpGridBagConstraints.weighty = 1.0;
    getJPanelImportSPDX().add(new JLabel(), tmpGridBagConstraints);

    checkValid();

    getJPanelImportSPDX().updateUI();
}

From source file:org.fhcrc.cpl.viewer.quant.gui.PanelWithLogRatioHistAndFields.java

/**
 * Set the log ratios, build the histogram and display, removing the old one if there was one.  Nothing gets
 * cleaned up related to the old chart; it'll just hang around intil GC
 * todo: do I need to dispose of the old chart in a better way?
 * @param logRatios/*from  w  w w .j av a  2 s . c  om*/
 */
public void setLogRatios(List<Float> logRatios) {
    _log.debug("setLogRatios 1");
    if (logRatioHistogram != null) {
        remove(logRatioHistogram);
    }
    this.logRatios = logRatios;

    float minLogRatioBound = (float) Math.log(minRatioBound);
    float maxLogRatioBound = (float) Math.log(maxRatioBound);

    _log.debug("setLogRatios 2");

    List<Float> boundedLogRatios = new ArrayList<Float>(logRatios.size());
    for (float logRatio : logRatios)
        boundedLogRatios.add(Math.min(maxLogRatioBound, Math.max(minLogRatioBound, logRatio)));

    logRatioHistogram = new PanelWithHistogram(boundedLogRatios, "Log Ratios", 200);
    Dimension histDimension = new Dimension(300, 80);
    if (!Float.isNaN(domainCrosshairValue)) {
        logRatioHistogram.getChart().getXYPlot().setDomainCrosshairValue(domainCrosshairValue, true);
        logRatioHistogram.getChart().getXYPlot().setDomainCrosshairVisible(true);
    }

    _log.debug("setLogRatios 1");

    logRatioHistogram.setPreferredSize(histDimension);
    logRatioHistogram.getChart().removeLegend();
    logRatioHistogram.getChart().getXYPlot().getDomainAxis().setLowerBound(minLogRatioBound);
    logRatioHistogram.getChart().getXYPlot().getDomainAxis().setUpperBound(maxLogRatioBound);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.BOTH;
    gbc.anchor = GridBagConstraints.LINE_START;
    gbc.insets = new Insets(0, 0, 0, 0);
    gbc.weighty = 10;
    gbc.weightx = 1;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    add(logRatioHistogram, gbc);

    histMouseListener = new LogRatioHistMouseListener(logRatioHistogram);
    ChartPanel histChartPanel = logRatioHistogram.getChartPanel();
    histChartPanel.setMouseZoomable(false);
    logRatioHistogram.getChartPanel().addMouseListener(histMouseListener);
    logRatioHistogram.getChartPanel().addMouseMotionListener(histMouseListener);
    histMouseListener.addRangeUpdateListener(new LogRatioHistogramListener(this));

    logRatioHistogram.updateUI();
    //if there are specified minHigh and maxHigh values, and they're valid, draw the initially selected region
    if (minHighRatio > maxLowRatio && minHighRatio > 0 && maxLowRatio > 0)
        updateSelectedRegion();

    //remove axes from chart
    ((XYPlot) logRatioHistogram.getPlot()).getRangeAxis().setVisible(false);
    ((XYPlot) logRatioHistogram.getPlot()).getDomainAxis().setVisible(false);

    logRatioHistogram.updateUI();
}

From source file:com.intel.stl.ui.main.view.NodeStatesPie.java

protected void fillLengendPanel(JPanel panel, PieDataset dataset, Color[] colors) {
    panel.removeAll();//  w ww  . ja va  2 s.  com
    GridBagConstraints gc = new GridBagConstraints();

    gc.fill = GridBagConstraints.BOTH;
    int size = dataset.getItemCount();
    stateLabels = new JLabel[size];
    for (int i = 0; i < size; i++) {
        gc.insets = new Insets(2, 5, 2, 2);
        gc.weightx = 0;
        gc.gridwidth = 1;

        JLabel label = new JLabel(dataset.getKey(i).toString(),
                Util.generateImageIcon(colors[i], 8, new Insets(1, 1, 1, 1)), JLabel.LEFT);
        label.setFont(UIConstants.H5_FONT);
        label.setForeground(UIConstants.INTEL_DARK_GRAY);
        panel.add(label, gc);

        gc.gridwidth = GridBagConstraints.REMAINDER;
        gc.weightx = 0;
        stateLabels[i] = new JLabel();
        stateLabels[i].setForeground(UIConstants.INTEL_DARK_GRAY);
        stateLabels[i].setFont(UIConstants.H3_FONT);
        panel.add(stateLabels[i], gc);
    }
}

From source file:com.intel.stl.ui.monitor.view.PSEventsCardView.java

@Override
protected JComponent getMainComponent() {

    if (mainPanel != null) {
        return mainPanel;
    }//from  ww w .  j  a  va2  s  . c o  m

    mainPanel = new JPanel(new GridBagLayout());
    mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 2, 5, 5));

    GridBagConstraints gc = new GridBagConstraints();
    gc.fill = GridBagConstraints.NONE;
    gc.weightx = 0;

    piePanel = new NodeStatesPie(false);
    piePanel.setOpaque(false);
    mainPanel.add(piePanel, gc);

    gc.fill = GridBagConstraints.BOTH;
    gc.weightx = 1;
    gc.weighty = 1;
    gc.gridwidth = GridBagConstraints.REMAINDER;
    barPanel = new ChartPanel(null);
    barPanel.setPreferredSize(new Dimension(60, 20));
    barPanel.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            barPanel.setMaximumDrawHeight(e.getComponent().getHeight());
            barPanel.setMaximumDrawWidth(e.getComponent().getWidth());
            barPanel.setMinimumDrawWidth(e.getComponent().getWidth());
            barPanel.setMinimumDrawHeight(e.getComponent().getHeight());
        }
    });
    barPanel.setOpaque(false);
    mainPanel.add(barPanel, gc);

    return mainPanel;

}

From source file:Main.java

private void initScreen() {
    setBorder(BorderFactory.createEtchedBorder());
    setLayout(new GridBagLayout());
    sourceLabel = new JLabel(DEFAULT_SOURCE_CHOICE_LABEL);
    sourceListModel = new SortedListModel();
    sourceList = new JList(sourceListModel);
    add(sourceLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.NONE, EMPTY_INSETS, 0, 0));
    add(new JScrollPane(sourceList), new GridBagConstraints(0, 1, 1, 5, .5, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, EMPTY_INSETS, 0, 0));

    addButton = new JButton(ADD_BUTTON_LABEL);
    add(addButton, new GridBagConstraints(1, 2, 1, 2, 0, .25, GridBagConstraints.CENTER,
            GridBagConstraints.NONE, EMPTY_INSETS, 0, 0));
    addButton.addActionListener(new AddListener());
    removeButton = new JButton(REMOVE_BUTTON_LABEL);
    add(removeButton, new GridBagConstraints(1, 4, 1, 2, 0, .25, GridBagConstraints.CENTER,
            GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
    removeButton.addActionListener(new RemoveListener());

    destLabel = new JLabel(DEFAULT_DEST_CHOICE_LABEL);
    destListModel = new SortedListModel();
    destList = new JList(destListModel);
    add(destLabel, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
            EMPTY_INSETS, 0, 0));//ww  w.j  a va 2s  . c  o  m
    add(new JScrollPane(destList), new GridBagConstraints(2, 1, 1, 5, .5, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, EMPTY_INSETS, 0, 0));
}

From source file:be.ac.ua.comp.scarletnebula.gui.windows.LinkUnlinkWindow.java

private final JPanel getMainPanel() {
    final JPanel mainPanel = new JPanel(new GridBagLayout());
    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
    final ServerList linkedServerList = new ServerList(linkedServerListModel);
    linkedServerList.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
    final JScrollPane linkedServerScrollPane = new JScrollPane(linkedServerList);
    linkedServerScrollPane// www  .j  av  a 2s .  c o  m
            .setBorder(BorderFactory.createTitledBorder(new EmptyBorder(5, 20, 20, 20), "Linked Servers"));
    // Doesn't matter what this is set to, as long as it's the same as the
    // one for unlinkedServerScrollPane
    linkedServerScrollPane.setPreferredSize(new Dimension(10, 10));

    final GridBagConstraints c = new GridBagConstraints();

    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0.5;
    c.weighty = 1.0;

    mainPanel.add(linkedServerScrollPane, c);

    final ServerList unlinkedServerList = new ServerList(unlinkedServerListModel);
    unlinkedServerList.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
    final JScrollPane unlinkedServerScrollPane = new JScrollPane(unlinkedServerList);
    unlinkedServerScrollPane
            .setBorder(BorderFactory.createTitledBorder(new EmptyBorder(5, 20, 20, 20), "Unlinked Servers"));

    // Doesn't matter what this is set to, as long as it's the same as the
    // one for unlinkedServerScrollPane
    unlinkedServerScrollPane.setPreferredSize(new Dimension(10, 10));

    final JPanel middlePanel = new JPanel();
    middlePanel.setLayout(new BoxLayout(middlePanel, BoxLayout.Y_AXIS));
    middlePanel.add(Box.createVerticalGlue());

    final JButton linkSelectionButton = new JButton("<");
    final JButton unlinkSelectionButton = new JButton(">");

    linkSelectionButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            // Move selection from unlinked to linked list
            final int selection = unlinkedServerList.getSelectedIndex();

            if (selection < 0) {
                return;
            }

            final Server server = unlinkedServerListModel.getVisibleServerAtIndex(selection);

            unlinkedServerListModel.removeServer(server);

            linkedServerListModel.addServer(server);
        }
    });

    unlinkSelectionButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            // Move selection from linked to unlinked list
            final int selection = linkedServerList.getSelectedIndex();

            if (selection < 0) {
                return;
            }

            final int answer = JOptionPane.showOptionDialog(LinkUnlinkWindow.this,
                    "You are about to unlink a server. "
                            + "Unlinking a server will permanently remove \nall data associated with "
                            + "this server, but the server will keep running. "
                            + "\n\nAre you sure you wish to continue?",
                    "Unlink Server", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, null, null);

            if (answer != JOptionPane.YES_OPTION) {
                return;
            }

            final Server server = linkedServerListModel.getVisibleServerAtIndex(selection);

            linkedServerListModel.removeServer(server);

            unlinkedServerListModel.addServer(server);
        }
    });

    middlePanel.add(unlinkSelectionButton);
    middlePanel.add(Box.createVerticalStrut(10));
    middlePanel.add(linkSelectionButton);
    middlePanel.add(Box.createVerticalGlue());

    c.gridx = 1;
    c.gridy = 0;
    c.weightx = 0.0;
    c.weighty = 0.0;

    mainPanel.add(middlePanel, c);

    c.gridx = 2;
    c.gridy = 0;
    c.weightx = 0.5;
    c.weighty = 1.0;

    mainPanel.add(unlinkedServerScrollPane, c);
    return mainPanel;
}

From source file:gdt.jgui.entity.contact.JContactEditor.java

public JContactEditor() {
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] { 100, 0, 0 };
    gridBagLayout.rowHeights = new int[] { 0, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0 };
    setLayout(gridBagLayout);//from  w w  w.  j a  v a 2s  .c  o m
    JLabel lblTitle = new JLabel("Label");

    GridBagConstraints gbc_lblTitle = new GridBagConstraints();
    gbc_lblTitle.insets = new Insets(5, 5, 5, 5);
    gbc_lblTitle.gridx = 0;
    gbc_lblTitle.gridy = 0;
    gbc_lblTitle.anchor = GridBagConstraints.NORTHWEST;
    add(lblTitle, gbc_lblTitle);
    title = new JTextField();

    GridBagConstraints gbc_title = new GridBagConstraints();
    gbc_title.insets = new Insets(5, 0, 5, 5);
    gbc_title.fill = GridBagConstraints.HORIZONTAL;
    gbc_title.gridx = 1;
    gbc_title.gridy = 0;
    add(title, gbc_title);
    title.setColumns(10);

    JLabel lblPhone = new JLabel("Phone");
    GridBagConstraints gbc_lblphone = new GridBagConstraints();
    gbc_lblphone.insets = new Insets(5, 5, 5, 5);
    gbc_lblphone.gridx = 0;
    gbc_lblphone.gridy = 1;
    gbc_lblphone.anchor = GridBagConstraints.NORTHWEST;
    add(lblPhone, gbc_lblphone);

    phone = new JTextField();
    GridBagConstraints gbc_phone = new GridBagConstraints();
    gbc_phone.insets = new Insets(5, 0, 5, 5);
    gbc_phone.fill = GridBagConstraints.HORIZONTAL;
    gbc_phone.gridx = 1;
    gbc_phone.gridy = 1;
    add(phone, gbc_phone);
    phone.setColumns(10);

    JLabel lblEmail = new JLabel("Email");
    GridBagConstraints gbc_lblEmail = new GridBagConstraints();
    gbc_lblEmail.insets = new Insets(5, 5, 5, 5);
    gbc_lblEmail.gridx = 0;
    gbc_lblEmail.gridy = 2;
    gbc_lblEmail.anchor = GridBagConstraints.NORTHWEST;
    add(lblEmail, gbc_lblEmail);

    email = new JTextField();
    GridBagConstraints gbc_email = new GridBagConstraints();
    gbc_phone.insets = new Insets(5, 0, 5, 5);
    gbc_email.fill = GridBagConstraints.HORIZONTAL;
    gbc_email.gridx = 1;
    gbc_email.gridy = 2;
    add(email, gbc_email);
    email.setColumns(10);
    JPanel panel = new JPanel();
    GridBagConstraints gbc_panel = new GridBagConstraints();
    gbc_panel.weighty = 1.0;
    gbc_panel.insets = new Insets(5, 0, 5, 5);
    gbc_panel.fill = GridBagConstraints.BOTH;
    gbc_panel.gridx = 0;
    gbc_panel.gridy = 3;
    add(panel, gbc_panel);
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
}

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

/**
 * This method initializes jPanel   //from w  ww .ja v  a2s .  com
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanel() {
    if (jPanel == null) {
        GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
        gridBagConstraints17.gridx = 1;
        gridBagConstraints17.anchor = GridBagConstraints.WEST;
        gridBagConstraints17.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints17.gridy = 16;
        jLabel6 = new JLabel();
        jLabel6.setText("");
        GridBagConstraints gridBagConstraints62 = new GridBagConstraints();
        gridBagConstraints62.gridx = 0;
        gridBagConstraints62.gridwidth = 2;
        gridBagConstraints62.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints62.anchor = GridBagConstraints.WEST;
        gridBagConstraints62.gridy = 6;
        GridBagConstraints gridBagConstraints51 = new GridBagConstraints();
        gridBagConstraints51.gridx = 0;
        gridBagConstraints51.gridy = 4;
        GridBagConstraints gridBagConstraints41 = new GridBagConstraints();
        gridBagConstraints41.fill = GridBagConstraints.BOTH;
        gridBagConstraints41.gridy = 3;
        gridBagConstraints41.weightx = 1.0;
        gridBagConstraints41.anchor = GridBagConstraints.WEST;
        gridBagConstraints41.gridx = 1;
        GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
        gridBagConstraints31.gridx = 0;
        gridBagConstraints31.anchor = GridBagConstraints.EAST;
        gridBagConstraints31.gridy = 3;
        jLabel9 = new JLabel();
        jLabel9.setText("Password");
        GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
        gridBagConstraints21.gridx = 0;
        gridBagConstraints21.anchor = GridBagConstraints.EAST;
        gridBagConstraints21.gridy = 2;
        jLabel8 = new JLabel();
        jLabel8.setText("email");
        GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
        gridBagConstraints16.fill = GridBagConstraints.BOTH;
        gridBagConstraints16.gridy = 2;
        gridBagConstraints16.weightx = 1.0;
        gridBagConstraints16.anchor = GridBagConstraints.WEST;
        gridBagConstraints16.gridx = 1;
        GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
        gridBagConstraints15.gridx = 1;
        gridBagConstraints15.gridy = 12;
        GridBagConstraints gridBagConstraints61 = new GridBagConstraints();
        gridBagConstraints61.gridx = 0;
        gridBagConstraints61.gridwidth = 1;
        gridBagConstraints61.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints61.gridheight = 4;
        gridBagConstraints61.fill = GridBagConstraints.NONE;
        gridBagConstraints61.weighty = 1.0;
        gridBagConstraints61.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints61.gridy = 10;
        jLabel7 = new JLabel();
        URL iconFile = this.getClass().getResource("/edu/harvard/mcz/imagecapture/resources/key_small.png");
        try {
            //this.setIconImage(new ImageIcon(iconFile).getImage());
            jLabel7.setIcon(new ImageIcon(iconFile));
        } catch (Exception e) {
            System.out.println("Can't open icon file: " + iconFile);
        }
        jLabel7.setText(" ");
        GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
        gridBagConstraints12.gridx = 1;
        gridBagConstraints12.anchor = GridBagConstraints.NORTH;
        gridBagConstraints12.fill = GridBagConstraints.NONE;
        gridBagConstraints12.gridy = 1;
        jLabel5 = new JLabel();
        jLabel5.setText("Connect to Database");
        jLabel4 = new JLabel();
        jLabel4.setText("Dialect");
        jLabel3 = new JLabel();
        jLabel3.setText("Connection");
        jLabel2 = new JLabel();
        jLabel2.setText("Driver");
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.gridy = 2;
        jLabel1 = new JLabel();
        jLabel1.setText("DBPassword");
        jLabel = new JLabel();
        jLabel.setText("Schema");
        jPanel = new JPanel();

        jPanel.setLayout(new GridBagLayout());
        jPanel.add(jLabel5, gridBagConstraints12);
        jPanel.add(jLabel7, gridBagConstraints61);
        jPanel.add(getJPanel1(), gridBagConstraints15);
        jPanel.add(getJTextFieldEmail(), gridBagConstraints16);
        jPanel.add(jLabel8, gridBagConstraints21);
        jPanel.add(jLabel9, gridBagConstraints31);
        jPanel.add(getJPasswordFieldUser(), gridBagConstraints41);
        jPanel.add(getJButton2(), gridBagConstraints51);
        jPanel.add(getJPanelAdvanced(), gridBagConstraints62);
        jPanel.add(jLabel6, gridBagConstraints17);
    }
    return jPanel;
}

From source file:org.gridchem.client.gui.panels.myccg.resource.HPCChartPanel.java

public HPCChartPanel(StatusListener statusListener) {
    super();//from  w  w  w .  ja v  a  2s.  c  om
    this.statusListener = statusListener;
    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1.0;
    c.weighty = 1.0;
    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;

    JPanel captionPanel = new JPanel();
    captionPanel.setLayout(new GridLayout(1, 2));
    captionPanel.add(new JLabel());
    captionPanel.add(new JLabel(DEFAULT_MESSAGE));
    captionPanel.add(new JLabel());
    add(captionPanel, c);
    c.weightx = 0;
    c.weighty = 0;
    c.gridx = 0;
    c.gridy = 1;

    navPanel = createSelectionBar();

    add(navPanel, c);
    enableSelectionBar(false);
    revalidate();

}