Example usage for java.awt GridBagConstraints NORTH

List of usage examples for java.awt GridBagConstraints NORTH

Introduction

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

Prototype

int NORTH

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

Click Source Link

Document

Put the component at the top of its display area, centered horizontally.

Usage

From source file:savant.view.variation.swing.VariationModule.java

private void showCard(JComponent card, String message) {
    if (currentCard != card) {
        if (currentCard != null) {
            remove(currentCard);//from  w ww  . j av a  2  s  . c  om
        }
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;

        gbc.fill = GridBagConstraints.BOTH;
        gbc.anchor = GridBagConstraints.NORTH;
        if (message != null) {
            if (card == messagePanel) {
                messageLabel.setText(message);
            } else {
                gbc.insets = new Insets(20, 20, 20, 20);
                gbc.fill = GridBagConstraints.HORIZONTAL;
                progressPanel.setMessage(message);
            }
        }
        add(card, gbc);
        currentCard = card;
        repaint();
        validate();
    }
}

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

/**
 * Creates a new SshToolsConnectionHostTab object.
 *///from  w  w w  .  j  a  v  a2  s  .  c o m
public SshToolsConnectionHostTab() {
    super();

    //  Create the main connection details panel
    JPanel mainConnectionDetailsPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets = new Insets(0, 2, 2, 2);
    gbc.weightx = 1.0;

    //  Host name
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Hostname"), gbc, GridBagConstraints.REMAINDER);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextHostname, gbc, GridBagConstraints.REMAINDER);
    gbc.fill = GridBagConstraints.NONE;

    //  Port
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Port"), gbc, GridBagConstraints.REMAINDER);
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextPort, gbc, GridBagConstraints.REMAINDER);

    //  Username
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Username"), gbc, GridBagConstraints.REMAINDER);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weighty = 1.0;
    UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextUsername, gbc, GridBagConstraints.REMAINDER);
    gbc.fill = GridBagConstraints.NONE;

    //
    IconWrapperPanel iconMainConnectionDetailsPanel = new IconWrapperPanel(
            new ResourceIcon(SshToolsConnectionHostTab.class, CONNECT_ICON), mainConnectionDetailsPanel);

    //  Authentication methods panel
    JPanel authMethodsPanel = new JPanel(new GridBagLayout());
    authMethodsPanel.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets = new Insets(2, 2, 2, 2);
    gbc.weightx = 1.0;
    gbc.weighty = 0.0;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 2;

    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc2.fill = GridBagConstraints.HORIZONTAL;
    gbc2.anchor = GridBagConstraints.NORTHWEST;
    gbc2.insets = new Insets(2, 2, 2, 2);
    gbc2.weightx = 1.0;
    gbc2.weighty = 0.0;
    gbc2.gridx = 0;
    gbc2.gridy = 1;
    gbc2.gridwidth = 2;

    GridBagConstraints gbc3 = new GridBagConstraints();
    gbc3.fill = GridBagConstraints.HORIZONTAL;
    gbc3.anchor = GridBagConstraints.NORTHWEST;
    gbc3.insets = new Insets(2, 2, 2, 2);
    gbc3.weightx = 1.0;
    gbc3.weighty = 0.0;
    gbc3.gridx = 0;
    gbc3.gridy = 2;
    gbc3.gridwidth = 2;

    GridBagConstraints gbc4 = new GridBagConstraints();
    gbc4.fill = GridBagConstraints.HORIZONTAL;
    gbc4.anchor = GridBagConstraints.NORTHWEST;
    gbc4.insets = new Insets(26, 2, 2, 2);
    gbc4.weightx = 0.0;
    gbc4.weighty = 0.0;
    gbc4.gridx = 0;
    gbc4.gridy = 3;
    gbc4.gridwidth = 1;

    GridBagConstraints gbc5 = new GridBagConstraints();
    gbc5.fill = GridBagConstraints.NONE;
    gbc5.anchor = GridBagConstraints.WEST;
    gbc5.insets = new Insets(26, 2, 2, 2);
    gbc5.weightx = 1.0;
    gbc5.weighty = 0.0;
    gbc5.gridx = 1;
    gbc5.gridy = 3;
    gbc5.gridwidth = 1;

    GridBagConstraints gbc6 = new GridBagConstraints();
    gbc6.fill = GridBagConstraints.HORIZONTAL;
    gbc6.anchor = GridBagConstraints.NORTHWEST;
    gbc6.insets = new Insets(12, 2, 2, 2);
    gbc6.weightx = 0.0;
    gbc6.weighty = 0.0;
    gbc6.gridx = 0;
    gbc6.gridy = 4;
    gbc6.gridwidth = 1;

    GridBagConstraints gbc7 = new GridBagConstraints();
    gbc7.fill = GridBagConstraints.NONE;
    gbc7.anchor = GridBagConstraints.WEST;
    gbc7.insets = new Insets(12, 2, 2, 2);
    gbc7.weightx = 1.0;
    gbc7.weighty = 0.0;
    gbc7.gridx = 1;
    gbc7.gridy = 4;
    gbc7.gridwidth = 1;

    GridBagConstraints gbc8 = new GridBagConstraints();
    gbc8.fill = GridBagConstraints.HORIZONTAL;
    gbc8.anchor = GridBagConstraints.NORTHWEST;
    gbc8.insets = new Insets(12, 2, 2, 2);
    gbc8.weightx = 0.0;
    gbc8.weighty = 0.0;
    gbc8.gridx = 0;
    gbc8.gridy = 5;
    gbc8.gridwidth = 1;

    GridBagConstraints gbc9 = new GridBagConstraints();
    gbc9.fill = GridBagConstraints.NONE;
    gbc9.anchor = GridBagConstraints.WEST;
    gbc9.insets = new Insets(12, 2, 2, 2);
    gbc9.weightx = 1.0;
    gbc9.weighty = 0.0;
    gbc9.gridx = 1;
    gbc9.gridy = 5;
    gbc9.gridwidth = 1;

    GridBagConstraints gbc10 = new GridBagConstraints();
    gbc10.fill = GridBagConstraints.HORIZONTAL;
    gbc10.anchor = GridBagConstraints.NORTHWEST;
    gbc10.insets = new Insets(26, 2, 2, 2);
    gbc10.weightx = 1.0;
    gbc10.weighty = 0.0;
    gbc10.gridx = 0;
    gbc10.gridy = 6;
    gbc10.gridwidth = 2;

    //  Authentication methods
    authMethodsPanel.add(new JLabel("Authentication Methods"), gbc);
    jListAuths.setVisibleRowCount(5);
    authMethodsPanel.add(new JScrollPane(jListAuths), gbc2);

    allowAgentForwarding = new JCheckBox("Allow agent forwarding");
    authMethodsPanel.add(allowAgentForwarding, gbc3);

    String options[] = { "Full", "Limited", "None" };
    delegationOption = new JComboBox(options);
    delegationOption.setSelectedIndex(0);
    authMethodsPanel.add(new JLabel("Delegation Type:"), gbc4);
    authMethodsPanel.add(delegationOption, gbc5);

    String optionsP[] = { "Pre-RFC Impersonation", "RFC Impersonation", "Legacy" };
    proxyOption = new JComboBox(optionsP);
    proxyOption.setSelectedIndex(0);
    authMethodsPanel.add(new JLabel("Proxy Type:"), gbc6);
    authMethodsPanel.add(proxyOption, gbc7);

    authMethodsPanel.add(new JLabel("Proxy Lifetime (hours):"), gbc8);
    proxyLength.setColumns(5);
    authMethodsPanel.add(proxyLength, gbc9);
    gbc.gridx = 0;
    proxySave = new JCheckBox("Save Grid Proxies to Disk");
    authMethodsPanel.add(proxySave, gbc10);

    //
    IconWrapperPanel iconAuthMethodsPanel = new IconWrapperPanel(
            new ResourceIcon(SshToolsConnectionHostTab.class, AUTH_ICON), authMethodsPanel);

    //  This panel
    JPanel mine = new JPanel();
    mine.setLayout(new GridBagLayout());
    mine.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.insets = new Insets(2, 2, 2, 2);
    gbc.weightx = 1.0;
    gbc.weighty = 0.0;
    gbc.gridx = 0;
    gbc.gridy = 0;
    mine.add(iconMainConnectionDetailsPanel, gbc);
    gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.weightx = 1.0;
    gbc.weighty = 0.0;
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.insets = new Insets(20, 2, 2, 2);
    mine.add(iconAuthMethodsPanel, gbc);
    setLayout(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    this.add(mine, BorderLayout.NORTH);
    //  Set up the values in the various components
    addAuthenticationMethods();
}

From source file:gdt.jgui.entity.query.JQueryPanel.java

/**
 * The default constructor./*from   www . j a v a 2 s.  co  m*/
 */
public JQueryPanel() {
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] { 100, 0, 0 };
    gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0 };
    setLayout(gridBagLayout);
    JLabel lblElement = new JLabel("Element");

    GridBagConstraints gbc_lblElement = new GridBagConstraints();
    gbc_lblElement.insets = new Insets(5, 5, 5, 5);
    gbc_lblElement.gridx = 0;
    gbc_lblElement.gridy = 0;
    gbc_lblElement.anchor = GridBagConstraints.FIRST_LINE_START;
    add(lblElement, gbc_lblElement);

    elementComboBox = new JComboBox<String>();
    GridBagConstraints gbc_elementComboBox = new GridBagConstraints();
    gbc_elementComboBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_elementComboBox.insets = new Insets(0, 0, 5, 0);
    gbc_elementComboBox.gridx = 1;
    gbc_elementComboBox.gridy = 0;
    gbc_elementComboBox.anchor = GridBagConstraints.FIRST_LINE_START;
    add(elementComboBox, gbc_elementComboBox);
    elementComboBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            try {
                initItemNameSelector();
            } catch (Exception ee) {
                LOGGER.severe(ee.toString());
            }
        }
    });
    JLabel lblItemNameField = new JLabel("Item field");
    GridBagConstraints gbc_lblItemField = new GridBagConstraints();
    gbc_lblItemField.insets = new Insets(5, 5, 5, 5);
    gbc_lblItemField.gridx = 0;
    gbc_lblItemField.gridy = 1;
    gbc_lblItemField.anchor = GridBagConstraints.FIRST_LINE_START;

    add(lblItemNameField, gbc_lblItemField);

    itemNameFieldComboBox = new JComboBox<String>();
    GridBagConstraints gbc_itemNameFieldComboBox = new GridBagConstraints();
    gbc_itemNameFieldComboBox.insets = new Insets(0, 0, 5, 0);
    gbc_itemNameFieldComboBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_itemNameFieldComboBox.gridx = 1;
    gbc_itemNameFieldComboBox.gridy = 1;
    gbc_itemNameFieldComboBox.anchor = GridBagConstraints.FIRST_LINE_START;
    add(itemNameFieldComboBox, gbc_itemNameFieldComboBox);
    itemNameFieldComboBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            try {
                initItemNameSelector();
                initItemValueSelector();
            } catch (Exception ee) {
                LOGGER.severe(ee.toString());
            }
        }
    });
    JLabel itemTitle = new JLabel("Item title");
    GridBagConstraints gbc_lblItemtitle = new GridBagConstraints();
    gbc_lblItemtitle.insets = new Insets(5, 5, 5, 5);
    gbc_lblItemtitle.gridx = 0;
    gbc_lblItemtitle.gridy = 2;
    gbc_lblItemtitle.anchor = GridBagConstraints.FIRST_LINE_START;
    add(itemTitle, gbc_lblItemtitle);

    itemNameComboBox = new JComboBox<String>();
    GridBagConstraints gbc_itemComboBox = new GridBagConstraints();
    gbc_itemComboBox.insets = new Insets(0, 0, 5, 0);
    gbc_itemComboBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_itemComboBox.gridx = 1;
    gbc_itemComboBox.gridy = 2;
    gbc_itemComboBox.anchor = GridBagConstraints.FIRST_LINE_START;
    add(itemNameComboBox, gbc_itemComboBox);
    itemNameComboBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            try {
                initItemValueSelector();
            } catch (Exception ee) {
                LOGGER.severe(ee.toString());
            }
        }
    });

    JLabel itemValue = new JLabel("Item value");
    GridBagConstraints gbc_lblItemValue = new GridBagConstraints();
    gbc_lblItemValue.insets = new Insets(5, 5, 5, 5);
    gbc_lblItemValue.weighty = 0.0;
    gbc_lblItemValue.gridx = 0;
    gbc_lblItemValue.gridy = 3;
    gbc_lblItemValue.anchor = GridBagConstraints.FIRST_LINE_START;
    add(itemValue, gbc_lblItemValue);

    itemValueComboBox = new JComboBox<String>();
    GridBagConstraints gbc_itemValueComboBox = new GridBagConstraints();
    gbc_itemValueComboBox.insets = new Insets(0, 0, 5, 0);
    gbc_itemValueComboBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_itemValueComboBox.gridx = 1;
    gbc_itemValueComboBox.gridy = 3;
    gbc_itemValueComboBox.anchor = GridBagConstraints.FIRST_LINE_START;
    add(itemValueComboBox, gbc_itemValueComboBox);
    table = new JTable();
    JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    table.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            int row = table.rowAtPoint(evt.getPoint());
            int col = table.columnAtPoint(evt.getPoint());
            System.out.println("JQueryPanel:cell click:row=" + row + " column=" + col);
            if (col == 1) {
                String label$ = (String) table.getValueAt(row, 1);
                System.out.println("JQueryPanel:cell click:label=" + label$);
                Entigrator entigrator = console.getEntigrator(entihome$);
                String entity$ = entigrator.indx_keyAtLabel(label$);
                JEntityFacetPanel efp = new JEntityFacetPanel();
                String efpLocator$ = efp.getLocator();
                efpLocator$ = Locator.append(efpLocator$, Entigrator.ENTIHOME, entihome$);
                efpLocator$ = Locator.append(efpLocator$, EntityHandler.ENTITY_KEY, entity$);
                JConsoleHandler.execute(console, efpLocator$);
            }
        }
    });
    GridBagConstraints gbc_scroll_panel = new GridBagConstraints();
    gbc_scroll_panel.anchor = GridBagConstraints.NORTH;
    gbc_scroll_panel.gridwidth = 2;
    gbc_scroll_panel.weighty = 1.0;
    gbc_scroll_panel.fill = GridBagConstraints.HORIZONTAL;
    gbc_scroll_panel.gridx = 0;
    gbc_scroll_panel.gridy = 4;
    add(scrollPane, gbc_scroll_panel);
    scrollPane.setMinimumSize(scrollPane.getPreferredSize());
}

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

/**
 * This method initializes jPanel   //from  w ww  . j a v  a2  s  . c  o  m
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanel() {
    if (jPanel == null) {
        GridBagConstraints gridBagConstraints24 = new GridBagConstraints();
        gridBagConstraints24.fill = GridBagConstraints.BOTH;
        gridBagConstraints24.gridy = 10;
        gridBagConstraints24.weightx = 1.0;
        gridBagConstraints24.anchor = GridBagConstraints.WEST;
        gridBagConstraints24.gridx = 1;
        GridBagConstraints gridBagConstraints113 = new GridBagConstraints();
        gridBagConstraints113.gridx = 0;
        gridBagConstraints113.anchor = GridBagConstraints.EAST;
        gridBagConstraints113.gridy = 10;
        jLabel9 = new JLabel();
        jLabel9.setText("Taxon Name Barcode");
        GridBagConstraints gridBagConstraints23 = new GridBagConstraints();
        gridBagConstraints23.fill = GridBagConstraints.BOTH;
        gridBagConstraints23.gridy = 13;
        gridBagConstraints23.weightx = 1.0;
        gridBagConstraints23.anchor = GridBagConstraints.WEST;
        gridBagConstraints23.gridx = 1;
        GridBagConstraints gridBagConstraints112 = new GridBagConstraints();
        gridBagConstraints112.gridx = 0;
        gridBagConstraints112.gridy = 13;
        GridBagConstraints gridBagConstraints22 = new GridBagConstraints();
        gridBagConstraints22.fill = GridBagConstraints.BOTH;
        gridBagConstraints22.gridy = 12;
        gridBagConstraints22.weightx = 1.0;
        gridBagConstraints22.anchor = GridBagConstraints.WEST;
        gridBagConstraints22.gridx = 1;
        GridBagConstraints gridBagConstraints111 = new GridBagConstraints();
        gridBagConstraints111.gridx = 0;
        gridBagConstraints111.gridy = 12;
        GridBagConstraints gridBagConstraints110 = new GridBagConstraints();
        gridBagConstraints110.gridx = 1;
        gridBagConstraints110.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints110.gridwidth = 1;
        gridBagConstraints110.anchor = GridBagConstraints.NORTH;
        gridBagConstraints110.gridy = 14;
        jLabelFeedback = new JLabel();
        jLabelFeedback.setText(" ");
        GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
        gridBagConstraints21.fill = GridBagConstraints.BOTH;
        gridBagConstraints21.gridy = 0;
        gridBagConstraints21.weightx = 2.0;
        gridBagConstraints21.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints21.gridx = 1;
        GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
        gridBagConstraints13.gridx = 0;
        gridBagConstraints13.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints13.gridy = 0;
        jLabel8 = new JLabel();
        jLabel8.setText("ImageFile");
        GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
        gridBagConstraints18.fill = GridBagConstraints.BOTH;
        gridBagConstraints18.gridy = 9;
        gridBagConstraints18.weightx = 1.0;
        gridBagConstraints18.anchor = GridBagConstraints.WEST;
        gridBagConstraints18.gridx = 1;
        GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
        gridBagConstraints17.fill = GridBagConstraints.BOTH;
        gridBagConstraints17.gridy = 8;
        gridBagConstraints17.weightx = 1.0;
        gridBagConstraints17.anchor = GridBagConstraints.WEST;
        gridBagConstraints17.gridx = 1;
        GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
        gridBagConstraints16.fill = GridBagConstraints.BOTH;
        gridBagConstraints16.gridy = 7;
        gridBagConstraints16.weightx = 1.0;
        gridBagConstraints16.anchor = GridBagConstraints.WEST;
        gridBagConstraints16.gridx = 1;
        GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
        gridBagConstraints15.fill = GridBagConstraints.BOTH;
        gridBagConstraints15.gridy = 6;
        gridBagConstraints15.weightx = 1.0;
        gridBagConstraints15.anchor = GridBagConstraints.WEST;
        gridBagConstraints15.gridx = 1;
        GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
        gridBagConstraints14.fill = GridBagConstraints.BOTH;
        gridBagConstraints14.gridy = 5;
        gridBagConstraints14.weightx = 1.0;
        gridBagConstraints14.anchor = GridBagConstraints.WEST;
        gridBagConstraints14.gridx = 1;
        GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
        gridBagConstraints12.fill = GridBagConstraints.BOTH;
        gridBagConstraints12.gridy = 3;
        gridBagConstraints12.weightx = 1.0;
        gridBagConstraints12.anchor = GridBagConstraints.WEST;
        gridBagConstraints12.gridx = 1;
        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
        gridBagConstraints11.gridx = 0;
        gridBagConstraints11.anchor = GridBagConstraints.EAST;
        gridBagConstraints11.gridy = 9;
        jLabel7 = new JLabel();
        jLabel7.setText("Specimen");
        jLabel7.setForeground(Color.ORANGE);
        GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
        gridBagConstraints10.gridx = 0;
        gridBagConstraints10.anchor = GridBagConstraints.EAST;
        gridBagConstraints10.gridy = 8;
        jLabel6 = new JLabel();
        jLabel6.setText("Tray Labels");
        jLabel6.setForeground(Color.CYAN);
        GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
        gridBagConstraints9.gridx = 0;
        gridBagConstraints9.anchor = GridBagConstraints.EAST;
        gridBagConstraints9.gridy = 7;
        jLabel5 = new JLabel();
        jLabel5.setText("Pin Labels");
        jLabel5.setForeground(Color.MAGENTA);
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.gridx = 0;
        gridBagConstraints8.anchor = GridBagConstraints.EAST;
        gridBagConstraints8.insets = new Insets(0, 3, 0, 0);
        gridBagConstraints8.gridy = 6;
        jLabel4 = new JLabel();
        jLabel4.setText("Taxon Name Label");
        jLabel4.setForeground(Color.BLUE);
        GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
        gridBagConstraints7.gridx = 0;
        gridBagConstraints7.anchor = GridBagConstraints.EAST;
        gridBagConstraints7.gridy = 5;
        jLabel3 = new JLabel();
        jLabel3.setText("Barcode");
        jLabel3.setForeground(Color.RED);
        GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
        gridBagConstraints6.gridx = 0;
        gridBagConstraints6.anchor = GridBagConstraints.EAST;
        gridBagConstraints6.gridy = 3;
        jLabel2 = new JLabel();
        jLabel2.setText("Image Size");
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.fill = GridBagConstraints.BOTH;
        gridBagConstraints5.gridy = 2;
        gridBagConstraints5.weightx = 1.0;
        gridBagConstraints5.anchor = GridBagConstraints.WEST;
        gridBagConstraints5.gridx = 1;
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.fill = GridBagConstraints.BOTH;
        gridBagConstraints4.gridy = 1;
        gridBagConstraints4.weightx = 1.0;
        gridBagConstraints4.anchor = GridBagConstraints.WEST;
        gridBagConstraints4.gridx = 1;
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.anchor = GridBagConstraints.EAST;
        gridBagConstraints2.gridy = 2;
        jLabel1 = new JLabel();
        jLabel1.setText("Name");
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.anchor = GridBagConstraints.EAST;
        gridBagConstraints1.gridy = 1;
        jLabel = new JLabel();
        jLabel.setText("Template ID");
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 11;
        jPanel = new JPanel();
        jPanel.setLayout(new GridBagLayout());
        jPanel.add(getJButtonSave(), gridBagConstraints);
        jPanel.add(jLabel, gridBagConstraints1);
        jPanel.add(jLabel1, gridBagConstraints2);
        jPanel.add(getJTextFieldTemplateId(), gridBagConstraints4);
        jPanel.add(getJTextFieldName(), gridBagConstraints5);
        jPanel.add(jLabel2, gridBagConstraints6);
        jPanel.add(jLabel3, gridBagConstraints7);
        jPanel.add(jLabel4, gridBagConstraints8);
        jPanel.add(jLabel5, gridBagConstraints9);
        jPanel.add(jLabel6, gridBagConstraints10);
        jPanel.add(jLabel7, gridBagConstraints11);
        jPanel.add(getJTextField2(), gridBagConstraints12);
        jPanel.add(getJTextField3(), gridBagConstraints14);
        jPanel.add(getJTextField4(), gridBagConstraints15);
        jPanel.add(getJTextField5(), gridBagConstraints16);
        jPanel.add(getJTextField6(), gridBagConstraints17);
        jPanel.add(getJTextField7(), gridBagConstraints18);
        jPanel.add(jLabel8, gridBagConstraints13);
        jPanel.add(getJTextField8(), gridBagConstraints21);
        jPanel.add(jLabelFeedback, gridBagConstraints110);
        jPanel.add(getJButton(), gridBagConstraints111);
        jPanel.add(getJTextFieldBarcodeScan(), gridBagConstraints22);
        jPanel.add(getJButton1(), gridBagConstraints112);
        jPanel.add(getJTextField(), gridBagConstraints23);
        jPanel.add(jLabel9, gridBagConstraints113);
        jPanel.add(getJTextField9(), gridBagConstraints24);
    }
    return jPanel;
}

From source file:de.cismet.cids.custom.objecteditors.wunda_blau.WebDavPicturePanel.java

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

    final RoundedPanel pnlFotos = new RoundedPanel();
    final SemiRoundedPanel pnlHeaderFotos = new SemiRoundedPanel();
    final JLabel lblHeaderFotos = new JLabel();
    final JPanel jPanel2 = new JPanel();
    final JPanel jPanel1 = new JPanel();
    final JScrollPane jspFotoList = new JScrollPane();
    lstFotos = new JList();
    final JPanel pnlCtrlButtons = new JPanel();
    btnAddImg = new JButton();
    btnRemoveImg = new JButton();
    final JPanel pnlMap = new JPanel();
    final RoundedPanel pnlVorschau = new RoundedPanel();
    final SemiRoundedPanel semiRoundedPanel2 = new SemiRoundedPanel();
    final JLabel lblVorschau = new JLabel();
    final JPanel jPanel3 = new JPanel();
    pnlFoto = new JPanel();
    lblPicture = new JLabel();
    lblBusy = new JXBusyLabel(new Dimension(75, 75));
    final JPanel pnlCtrlBtn = new JPanel();
    btnPrevImg = new JButton();
    btnNextImg = new JButton();

    final FormListener formListener = new FormListener();

    setName("Form"); // NOI18N
    setOpaque(false);
    setLayout(new GridBagLayout());

    pnlFotos.setMinimumSize(new Dimension(400, 200));
    pnlFotos.setName("pnlFotos"); // NOI18N
    pnlFotos.setPreferredSize(new Dimension(400, 200));
    pnlFotos.setLayout(new GridBagLayout());

    pnlHeaderFotos.setBackground(new Color(51, 51, 51));
    pnlHeaderFotos.setForeground(new Color(51, 51, 51));
    pnlHeaderFotos.setName("pnlHeaderFotos"); // NOI18N
    pnlHeaderFotos.setLayout(new FlowLayout());

    lblHeaderFotos.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblHeaderFotos,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblHeaderFotos.text")); // NOI18N
    lblHeaderFotos.setName("lblHeaderFotos"); // NOI18N
    pnlHeaderFotos.add(lblHeaderFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlFotos.add(pnlHeaderFotos, gridBagConstraints);

    jPanel2.setName("jPanel2"); // NOI18N
    jPanel2.setOpaque(false);
    jPanel2.setLayout(new GridBagLayout());

    jPanel1.setName("jPanel1"); // NOI18N
    jPanel1.setOpaque(false);
    jPanel1.setLayout(new GridBagLayout());

    jspFotoList.setMinimumSize(new Dimension(250, 130));
    jspFotoList.setName("jspFotoList"); // NOI18N

    lstFotos.setMinimumSize(new Dimension(250, 130));
    lstFotos.setName("lstFotos"); // NOI18N
    lstFotos.setPreferredSize(new Dimension(250, 130));

    final ELProperty eLProperty = ELProperty.create("${cidsBean." + beanCollProp + "}");
    final JListBinding jListBinding = SwingBindings.createJListBinding(AutoBinding.UpdateStrategy.READ_WRITE,
            this, eLProperty, lstFotos);
    bindingGroup.addBinding(jListBinding);

    lstFotos.addListSelectionListener(formListener);
    jspFotoList.setViewportView(lstFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    jPanel1.add(jspFotoList, gridBagConstraints);

    pnlCtrlButtons.setName("pnlCtrlButtons"); // NOI18N
    pnlCtrlButtons.setOpaque(false);
    pnlCtrlButtons.setLayout(new GridBagLayout());

    btnAddImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_add_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnAddImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnAddImg.text")); // NOI18N
    btnAddImg.setBorderPainted(false);
    btnAddImg.setContentAreaFilled(false);
    btnAddImg.setName("btnAddImg"); // NOI18N
    btnAddImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.insets = new Insets(0, 0, 5, 0);
    pnlCtrlButtons.add(btnAddImg, gridBagConstraints);

    btnRemoveImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_remove_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnRemoveImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnRemoveImg.text")); // NOI18N
    btnRemoveImg.setBorderPainted(false);
    btnRemoveImg.setContentAreaFilled(false);
    btnRemoveImg.setName("btnRemoveImg"); // NOI18N
    btnRemoveImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new Insets(5, 0, 0, 0);
    pnlCtrlButtons.add(btnRemoveImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    jPanel1.add(pnlCtrlButtons, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 10, 0);
    jPanel2.add(jPanel1, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(0, 0, 2, 0);
    pnlFotos.add(jPanel2, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 0, 5, 5);
    add(pnlFotos, gridBagConstraints);

    pnlMap.setBorder(BorderFactory.createEtchedBorder());
    pnlMap.setMinimumSize(new Dimension(400, 200));
    pnlMap.setName("pnlMap"); // NOI18N
    pnlMap.setPreferredSize(new Dimension(400, 200));
    pnlMap.setLayout(new BorderLayout());
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.VERTICAL;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(5, 0, 0, 5);
    add(pnlMap, gridBagConstraints);
    pnlMap.add(map, BorderLayout.CENTER);

    pnlVorschau.setName("pnlVorschau"); // NOI18N
    pnlVorschau.setLayout(new GridBagLayout());

    semiRoundedPanel2.setBackground(new Color(51, 51, 51));
    semiRoundedPanel2.setName("semiRoundedPanel2"); // NOI18N
    semiRoundedPanel2.setLayout(new FlowLayout());

    lblVorschau.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblVorschau,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblVorschau.text")); // NOI18N
    lblVorschau.setName("lblVorschau"); // NOI18N
    semiRoundedPanel2.add(lblVorschau);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlVorschau.add(semiRoundedPanel2, gridBagConstraints);

    jPanel3.setName("jPanel3"); // NOI18N
    jPanel3.setOpaque(false);
    jPanel3.setLayout(new GridBagLayout());

    pnlFoto.setName("pnlFoto"); // NOI18N
    pnlFoto.setOpaque(false);
    pnlFoto.setLayout(new GridBagLayout());

    lblPicture.setHorizontalAlignment(SwingConstants.CENTER);
    Mnemonics.setLocalizedText(lblPicture,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblPicture.text")); // NOI18N
    lblPicture.setName("lblPicture"); // NOI18N
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblPicture, gridBagConstraints);

    lblBusy.setHorizontalAlignment(SwingConstants.CENTER);
    lblBusy.setMaximumSize(new Dimension(140, 40));
    lblBusy.setMinimumSize(new Dimension(140, 60));
    lblBusy.setName("lblBusy"); // NOI18N
    lblBusy.setPreferredSize(new Dimension(140, 60));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblBusy, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 0, 10);
    jPanel3.add(pnlFoto, gridBagConstraints);

    pnlCtrlBtn.setName("pnlCtrlBtn"); // NOI18N
    pnlCtrlBtn.setOpaque(false);
    pnlCtrlBtn.setPreferredSize(new Dimension(100, 50));
    pnlCtrlBtn.setLayout(new GridBagLayout());

    btnPrevImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-left.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnPrevImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnPrevImg.text")); // NOI18N
    btnPrevImg.setBorderPainted(false);
    btnPrevImg.setFocusPainted(false);
    btnPrevImg.setName("btnPrevImg"); // NOI18N
    btnPrevImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnPrevImg, gridBagConstraints);

    btnNextImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-right.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnNextImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnNextImg.text")); // NOI18N
    btnNextImg.setBorderPainted(false);
    btnNextImg.setFocusPainted(false);
    btnNextImg.setName("btnNextImg"); // NOI18N
    btnNextImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnNextImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.insets = new Insets(0, 10, 10, 10);
    jPanel3.add(pnlCtrlBtn, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlVorschau.add(jPanel3, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    add(pnlVorschau, gridBagConstraints);

    bindingGroup.bind();
}

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

/**
 * MidPanel contains Video Manifests//from  w w  w  .  j a v  a 2  s .c o  m
 */
private JPanel buildManifestsGroup() {

    JPanel pane;
    pane = new JPanel(new GridBagLayout());

    int section = 0;

    videoManifestPanel = new VideoManifestPanel(overviewRoute, aroView);
    pane.add(videoManifestPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));
    bpObservable.registerObserver(videoManifestPanel);

    JPanel wrapper = getTitledWrapper("video.tab.manifest.title", new LoadManifestDialog(aroView));
    wrapper.add(pane, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));

    pane.setBorder(BorderFactory.createLineBorder(Color.WHITE));

    return wrapper;
}

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

/**
 * MidPanel contains Video Requests/*from   w  w  w. j a  v  a 2 s. com*/
 */
private JPanel buildRequestsGroup() {

    JPanel pane;
    pane = new JPanel(new GridBagLayout());

    int section = 0;

    VideoRequestPanel requestPanel = new VideoRequestPanel();
    pane.add(requestPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));
    bpObservable.registerObserver(requestPanel);

    JPanel wrapper = getTitledWrapper("video.tab.request.title", null);
    wrapper.add(pane, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));
    return wrapper;
}

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

private JPanel getTitledWrapper(String title, JComponent component) {

    JPanel pane = new JPanel(new GridBagLayout());

    pane.setOpaque(false);/* ww  w .  jav a2  s.  c  o m*/
    pane.setBorder(new RoundedBorder(new Insets(0, 10, 10, 10), Color.WHITE));

    JPanel fullPanel = new JPanel(new BorderLayout());

    fullPanel.setOpaque(false);

    // Create the header bar
    BpHeaderPanel header = new BpHeaderPanel(ResourceBundleHelper.getMessageString(title));
    header.setImageTitle(Images.BLUE_HEADER.getImage(), null);
    if (component != null) {
        header.add(component, BorderLayout.EAST);
    }
    fullPanel.add(header, BorderLayout.NORTH);
    pane.add(fullPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, headInsets, 0, 0));
    return pane;
}

From source file:Citas.FrameCita.java

public FrameCita()
        throws ClientProtocolException, IOException, JSONException, ParseException, java.text.ParseException {

    initComponents();/*w w w .  j av  a 2  s  .com*/
    this.getContentPane().setLayout(new GridBagLayout());
    rutasLeer = new Leer();
    rutasAdd = new Add();
    medico = new Medico(2, 0, 3, 30); //MEDICO EN SESIOOON
    citas = new Citas[medico.cantidadDeCitasxDia(10, 30)];

    try {
        font = Font.createFont(Font.TRUETYPE_FONT, new File("Sertig.otf"));
        font = font.deriveFont(Font.BOLD, 11);
    } catch (FontFormatException ex) {
        Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
    }

    setTitle("Citas");

    GridBagConstraints gbc = new GridBagConstraints();

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.5;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.BOTH;
    this.getContentPane().add(PanelCalendar, gbc);
    gbc.weightx = 0.0;
    gbc.weighty = 0.0;

    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 1.0;
    this.getContentPane().add(PanelCita, gbc);

    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.gridheight = 2;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    this.getContentPane().add(PanelDetalle, gbc);

    ////////////////// PANEL DETALLES

    //Colores
    colorBackGround = new Color(hex("8FA8F6"));//Color de los BackGround 
    colorTextFields = new Color(hex("CDCBA6"));//Color de los JTextFields
    colorDelPapa = new Color(hex("2980b9"));//Color del backgorud del papa
    colorBotones = new Color(hex("2C3E50"));//Color d elos botonte
    colorActivo = new Color(hex("81CFE0"));//Color de los jTextFild cuando los activan
    //Colores

    //Inicializaciones

    this.setBackground(colorDelPapa);//Color del backgroud
    //BOTONES INICIALIZACION
    modificarB = new JButton("Modificar");
    eliminarB = new JButton("Eliminar");
    agregarB = new JButton("Agregar");
    atrasB = new JButton("Atras");
    buscarB = new JButton("Buscar");
    Botones = new JPanel(); //PAnel donde van los botones Agregar, Modificar y Eliminar
    BotonAtras = new JPanel(); //PAnel donde va el boton atras
    BotonBuscar = new JPanel(); //PAnel donde va el boton buscar
    agregarB.addActionListener(this);
    modificarB.addActionListener(this);
    eliminarB.addActionListener(this);
    atrasB.addActionListener(this);
    buscarB.addActionListener(this);
    // FIN BOTONES INICIALIZACION

    PanelCita.setLayout(new GridBagLayout());

    disenoBotones(modificarB);
    disenoBotones(eliminarB);
    disenoBotones(agregarB);
    disenoBotones(atrasB);
    disenoBotones(buscarB);
    PanelDetalle.setLayout(new GridBagLayout()); //Panel Pap (PanelDetalle)
    cambiarColorPanel(PanelCalendar, colorDelPapa);
    cambiarColorPanel(PanelCita, colorDelPapa);
    cambiarColorPanel(PanelDetalle, colorDelPapa);

    //LABELS
    horaCitas = new JLabel();
    fechaL = new JLabel("<HTML> Fecha &nbsp</HTML>");
    horaL = new JLabel("<HTML> Hora &nbsp</HTML>");
    nombreL = new JLabel("<HTML> Nombre &nbsp &nbsp </HTML>");
    apellidoL = new JLabel("<HTML> Apellido &nbsp &nbsp &nbsp</HTML>");
    cedulaL = new JLabel("<HTML> Cedula &nbsp &nbsp &nbsp &nbsp &nbsp</HTML>");
    direccionL = new JLabel("<HTML> Direccion &nbsp &nbsp</HTML>");
    motivosL = new JLabel("<HTML> Motivos &nbsp &nbsp &nbsp &nbsp</HTML>");
    telefonoCasaL = new JLabel("<HTML> Tlfn Casa&nbsp </HTML>");
    telefonoCelularL = new JLabel("<HTML> Tlfn Celular</HTML>");
    correoL = new JLabel("<HTML> Correo &nbsp &nbsp &nbsp</HTML>");

    font = font = font.deriveFont(Font.BOLD, 11);
    disenoLabel(horaCitas);
    disenoLabel(fechaL);
    disenoLabel(horaL);
    disenoLabel(nombreL);
    disenoLabel(apellidoL);
    disenoLabel(cedulaL);
    disenoLabel(direccionL);
    disenoLabel(motivosL);
    disenoLabel(telefonoCasaL);
    disenoLabel(telefonoCelularL);
    disenoLabel(correoL);

    //JTEXTFIELDS y TEXAREA

    fechaJ = new JTextField("");
    horaJ = new JTextField("");
    nombreJ = new JTextField("");
    apellidoJ = new JTextField("");
    cedulaJ = new JTextField("");
    direccionJ = new JTextField();
    motivosTA = new JTextArea("");
    telefonoCasaJ = new JTextField("");
    telefonoCelularJ = new JTextField("");
    correoJ = new JTextField("");
    //COLORES
    /*fechaJ.setBackground(colorTextFields);
    horaJ.setBackground(colorTextFields);
    nombreJ.setBackground(colorTextFields);
    apellidoJ.setBackground(colorTextFields);
    cedulaJ.setBackground(colorTextFields);
    direccionJ.setBackground(colorTextFields);
    motivosTA .setBackground(colorTextFields);
    telefonoCasaJ.setBackground(colorTextFields);
    telefonoCelularJ.setBackground(colorTextFields);
    correoJ.setBackground(colorTextFields);
    */
    //Aadir componentes al PanelDetalle
    GridBagConstraints constraints = new GridBagConstraints();

    //Caracteristicas globales del grid
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weighty = 1.0;
    constraints.insets.set(5, 0, 5, 10);
    //Fin Caracteristicas Globales del grid

    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(fechaL, constraints);

    constraints.gridx = 1; //Necesita estirarse
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(fechaJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(horaL, constraints);

    constraints.gridx = 1; //Necesita estirarse
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(horaJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(nombreL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(nombreJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(apellidoL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(apellidoJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(cedulaL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(cedulaJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(direccionL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(direccionJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 6;
    constraints.gridwidth = 1;
    constraints.gridheight = 2;
    constraints.weighty = 1.0;
    PanelDetalle.add(motivosL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 6;
    constraints.gridwidth = 1;
    constraints.gridheight = 2;
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    PanelDetalle.add(motivosTA, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 8;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(telefonoCasaL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 8;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(telefonoCasaJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 9;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(telefonoCelularL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 9;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(telefonoCelularJ, constraints);
    constraints.weightx = 0.0;

    constraints.gridx = 0;
    constraints.gridy = 10;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    PanelDetalle.add(correoL, constraints);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 10;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1.0;
    PanelDetalle.add(correoJ, constraints);
    constraints.weightx = 0.0;

    //PANEL DE LOS BOTONES

    constraints.insets.set(30, 0, 10, 10);

    constraints.gridx = 1;//Necesita estirarse
    constraints.gridy = 11;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0.0;
    FlowLayout flowLayout1 = new FlowLayout();
    Botones.setLayout(flowLayout1);
    Botones.add(agregarB);
    Botones.add(modificarB);
    Botones.add(eliminarB);
    PanelDetalle.add(Botones, constraints);

    //Boton Buscar
    constraints.anchor = GridBagConstraints.NORTH;
    constraints.insets.set(10, 0, 0, 0);
    constraints.gridx = 2;//Necesita estirarse
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 0;
    constraints.weightx = 0.0;
    BotonBuscar.setLayout(flowLayout1);
    BotonBuscar.add(buscarB);
    BotonBuscar.setBackground(colorBackGround);
    PanelDetalle.add(BotonBuscar, constraints);
    constraints.insets.set(30, 0, 10, 10);

    //BOTON ATRAS

    constraints.insets.set(30, 0, 10, 10);
    constraints.gridx = 2;//Necesita estirarse
    constraints.gridy = 11;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0.0;

    BotonAtras.setLayout(flowLayout1);
    BotonAtras.add(atrasB);

    PanelDetalle.add(BotonAtras, constraints);

    cambiarColorPanel(Botones, colorDelPapa);
    cambiarColorPanel(BotonBuscar, colorDelPapa);
    cambiarColorPanel(BotonAtras, colorDelPapa);

    PanelDetalle.setVisible(true);

    //////////////////////ULTIMAS MOTIFICACIONES PRIMER INCREMENTO
    atrasB.setEnabled(false);
    buscarB.setEnabled(false);
    modificarB.setEnabled(false);
    agregarB.setEnabled(false);
    eliminarB.setEnabled(false);
    fechaJ.setEditable(false);
    horaJ.setEditable(false);
    nombreJ.setEditable(false);
    apellidoJ.setEditable(false);
    cedulaJ.setEditable(false);
    direccionJ.setEditable(false);
    motivosTA.setEditable(false);
    telefonoCasaJ.setEditable(false);
    telefonoCelularJ.setEditable(false);
    correoJ.setEditable(false);

    /////////////////////FIN ULTIMAS MOTIFICACIONES PRIMER INCREMENTO

    /////////////////Para enero

    setCitas();
    dibujarPanelCita(medico);//Dibuja la "libreta" de las citas

    /////// fin para ENERO

    //jCalendar1.getDayChooser().addDateEvaluator(new DJFechasEspInv());//Pinta las Fechas ocupadas en rojo
    jCalendar1.addPropertyChangeListener("calendar", new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            try {
                try {
                    setCitas();
                } catch (ClientProtocolException ex) {
                    Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
                } catch (ParseException ex) {
                    Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
                } catch (java.text.ParseException ex) {
                    Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
                }
            } catch (IOException ex) {
                Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
            } catch (JSONException ex) {
                Logger.getLogger(FrameCita.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    });

}

From source file:zet.gui.assignmentEditor.JAssignmentPanel.java

/**
 * Returns the panel on the right side of the {@code JAssignmentPanel} that
 * contains distributions for all properties and a plot of the distribution
 * with the current parameters./*ww  w  . j  a va 2 s . c o m*/
 * @return the panel on the right side of the {@code JAssignmentPanel}
 */
private JPanel getRightPanel() {
    final JPanel rightPanel = new JPanel(new GridBagLayout());

    final JPanel tableContainer = new JPanel(new BorderLayout());
    tableContainer.add(distributionTable.getTableHeader(), BorderLayout.PAGE_START);
    tableContainer.add(distributionTable, BorderLayout.CENTER);

    rightPanel.add(tableContainer, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    XYSeriesCollection c = new XYSeriesCollection();
    chart = ChartFactory.createXYLineChart(loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Title"),
            loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Values"), // x axis label
            loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Probability"), // y axis label
            c, // Dataset
            PlotOrientation.VERTICAL, false, true, false // Show legend, tooltips, url
    );

    chartPanel = new ChartPanel(chart);
    rightPanel.add(chartPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    rightPanel.add(chartPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    return rightPanel;
}