Package java.awt

Examples of java.awt.GridBagLayout$ComponentSide


      gridBagConstraints.gridx = 0;
      gridBagConstraints.gridy = 0;
      waitTextLabel = new JLabel();
      waitTextLabel.setText(waitText);
      jContentPane = new JPanel();
      jContentPane.setLayout(new GridBagLayout());
      jContentPane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED),
          BorderFactory.createBevelBorder(BevelBorder.LOWERED)));
      jContentPane.add(waitTextLabel, gridBagConstraints);
      jContentPane.add(getWaitProgressBar(), gridBagConstraints1);
    }
View Full Code Here


        initializeComponent();
    }
   
    private void initializeComponent() {
        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        // Parameters
        JLabel nameLabel = new JLabel("Name");
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(nameLabel, c);
        String taskName = (String) workItem.getParameter("TaskName");
        JTextField nameField = new JTextField(
            taskName == null ? "" : taskName);
        nameField.setEditable(false);
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(nameField, c);
       
        JLabel priorityLabel = new JLabel("Priority");
        c = new GridBagConstraints();
        c.gridy = 1;
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(priorityLabel, c);
        String priority = (String) workItem.getParameter("Priority");
        JTextField priorityField = new JTextField(
            priority == null ? "" : priority);
        priorityField.setEditable(false);
        c = new GridBagConstraints();
        c.gridy = 1;
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(priorityField, c);
       
        JLabel commentLabel = new JLabel("Comment");
        c = new GridBagConstraints();
        c.gridy = 2;
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(commentLabel, c);
        String comment = (String) workItem.getParameter("Comment");
        JTextArea params = new JTextArea(
            comment == null ? "" : comment);
        params.setEditable(false);
        c = new GridBagConstraints();
        c.gridy = 2;
        c.weightx = 1;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(params, c);
       
        int additionalParameters = 0;
        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
            String name = entry.getKey();
            if (!"TaskName".equals(name)
                    && !"Priority".equals(name)
                    && !"Comment".equals(name)
                    && !"ActorId".equals(name)) {
                additionalParameters++;
                JLabel label = new JLabel(name);
                c = new GridBagConstraints();
                c.gridy = 2 + additionalParameters;
                c.anchor = GridBagConstraints.WEST;
                c.insets = new Insets(5, 5, 5, 5);
                panel.add(label, c);
                JTextField field = new JTextField(
                    workItem.getParameter(name).toString());
                field.setEditable(false);
                c = new GridBagConstraints();
                c.gridy = 2 + additionalParameters;
                c.weightx = 1;
                c.fill = GridBagConstraints.HORIZONTAL;
                c.insets = new Insets(5, 5, 5, 5);
                panel.add(field, c);
            }
        }
       
        // Result Panel
        JPanel resultPanel = new JPanel();
        resultPanel.setLayout(new GridBagLayout());
        resultPanel.setBorder(new TitledBorder("Results"));
       
        JLabel resultNameLabel = new JLabel("Name");
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultNameLabel, c);
        resultNameField = new JTextField();
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultNameField, c);
        JLabel resultValueLabel = new JLabel("Value");
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultValueLabel, c);
        resultValueField = new JTextField();
        c = new GridBagConstraints();
        c.weightx = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(resultValueField, c);
        JButton addResultButton = new JButton("Add");
        addResultButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                addResult();
            }
        });
        c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(addResultButton, c);
       
        resultList = new JList();
        resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        resultList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                removeResultButton.setEnabled(resultList.getSelectedIndex() != -1);
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.gridwidth = 4;
        c.weightx = 1;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(5, 5, 5, 5);
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setViewportView(resultList);
        resultPanel.add(scrollPane, c);
        removeResultButton = new JButton("Remove");
        removeResultButton.setEnabled(false);
        removeResultButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                removeResult();
            }
        });
        c = new GridBagConstraints();
        c.gridy = 1;
        c.anchor = GridBagConstraints.NORTH;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(removeResultButton, c);
       
        c = new GridBagConstraints();
        c.gridy = 3 + additionalParameters;
        c.gridwidth = 2;
        c.weighty = 1;
        c.fill = GridBagConstraints.BOTH;
        panel.add(resultPanel, c);
       
       
        // Buttom Panel
        JPanel bottomPanel = new JPanel();
        bottomPanel.setLayout(new GridBagLayout());
        completeButton = new JButton("Complete");
        completeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                complete();
            }
View Full Code Here

        initializeComponent();
    }
   
    private void initializeComponent() {
        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        JLabel label = new JLabel("Actor");
        GridBagConstraints c = new GridBagConstraints();
View Full Code Here

        initializeComponent();
    }
   
    private void initializeComponent() {
        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
View Full Code Here

        initializeComponent();
    }

    private void initializeComponent() {
        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        JTextArea params = new JTextArea();
        params.setText(getParameters());
View Full Code Here

/**
* Builds the panel.
*/
protected void buildPanel() {
    GridBagLayout bag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(6, 6, 6, 6);
    panel = new JPanel();
    panel.setLayout(bag);
    if (border != null)
  panel.setBorder(border);

    c.gridy = 0;
    for (Iterator iter = rows.iterator(); iter.hasNext(); ++c.gridy) {
  Row row = (Row)iter.next();
  if (row == null)
      continue;

  if (row.label != null) {
      c.gridx = 0;
      c.anchor = GridBagConstraints.NORTHEAST;
      bag.setConstraints(row.label, c);
      panel.add(row.label);
  }

  if (row.component != null) {
      c.gridx = 1;
      c.anchor = GridBagConstraints.NORTHWEST;
      bag.setConstraints(row.component, c);
      panel.add(row.component);
  }
    }
}
View Full Code Here

    errorLabels = new HashMap<String, JLabel>();
    globalErrorMessage = new JLabel();
    autoUpdateCheckbox = new JCheckBox(messages.getString("ParameterReportControllerPane.AutoUpdate"));
    updateButton = new JButton(new UpdateAction());

    setLayout(new GridBagLayout());
    parameterEditorFactory = new DefaultParameterComponentFactory();
    updateContext = new InternalParameterUpdateHandler();

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridy = 0;
View Full Code Here

     * Creates a new <code>JPanel</code> with a double buffer
     * and a flow layout.
     */
    private ParameterCarrierPanel()
    {
      setLayout(new GridBagLayout());
    }
View Full Code Here

    scroller = new JScrollPane(backtraceArea);
    scroller.setVisible(false);

    final JPanel detailPane = new JPanel();
    detailPane.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
View Full Code Here

   */
  private void initialize()
  {
    final JPanel contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new GridBagLayout());

    pageMessageFormatter = new MessageFormat(messages.getString("progress-dialog.page-label")); //$NON-NLS-1$
    rowsMessageFormatter = new MessageFormat(messages.getString("progress-dialog.rows-label")); //$NON-NLS-1$
    passMessageFormatter = new MessageFormat(messages.getString("progress-dialog.pass-label-0")); //$NON-NLS-1$

View Full Code Here

TOP

Related Classes of java.awt.GridBagLayout$ComponentSide

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.