Package java.awt

Examples of java.awt.GridBagLayout$Segment


    this.iconPreviewComponent = new ModelPreviewComponent();
    Insets insets = this.iconPreviewComponent.getInsets();
    this.iconPreviewComponent.setPreferredSize(
        new Dimension(128 + insets.left + insets.right, 128  + insets.top + insets.bottom));
    // Change layout
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);
    layout.setConstraints(getComponent(0), new GridBagConstraints(1, 0, 1, 1, 0, 1,
        GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 10, 0), 0, 0));
    layout.setConstraints(getComponent(1), new GridBagConstraints(1, 1, 1, 1, 0, 1,
        GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    add(this.iconPreviewComponent, new GridBagConstraints(0, 0, 1, 2, 1, 1,
        GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 10), 0, 0));
  }
View Full Code Here


   * @param preferences user preferences
   * @param controller the controller of this panel
   */
  public FurniturePanel(UserPreferences preferences,
                        FurnitureController controller) {
    super(new GridBagLayout());
    this.preferences = preferences;
    this.controller = controller;
    createComponents(preferences, controller);
    setMnemonics(preferences);
    layoutComponents();
View Full Code Here

      printerView.setSelected(true);
      header = new JTextField(20);
      header.setText("%n (%p of %P)");
     
      // set up panel
      gridbag = new GridBagLayout();
      gbc = new GridBagConstraints();
      setLayout(gridbag);
     
      // now add components into panel
      gbc.gridy = 0;
View Full Code Here

    custom.addActionListener(myListener);
    templateField.setEditable(false);
    templateButton.addActionListener(myListener);
    myListener.computeEnabled();
   
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    setLayout(gridbag);
    gbc.weightx = 1.0;
    gbc.gridx = 0;
    gbc.gridy = GridBagConstraints.RELATIVE;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.LINE_START;
    gridbag.setConstraints(plain, gbc); add(plain);
    gridbag.setConstraints(empty, gbc); add(empty);
    gridbag.setConstraints(custom, gbc); add(custom);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridwidth = 1;
    gbc.gridy = 3;
    gbc.gridx = GridBagConstraints.RELATIVE;
    JPanel strut = new JPanel();
    strut.setMinimumSize(new Dimension(50, 1));
    strut.setPreferredSize(new Dimension(50, 1));
    gbc.weightx = 0.0; gridbag.setConstraints(strut, gbc); add(strut);
    gbc.weightx = 1.0; gridbag.setConstraints(templateField, gbc); add(templateField);
    gbc.weightx = 0.0; gridbag.setConstraints(templateButton, gbc); add(templateButton);
   
    AppPreferences.addPropertyChangeListener(AppPreferences.TEMPLATE_TYPE, myListener);
    AppPreferences.addPropertyChangeListener(AppPreferences.TEMPLATE_FILE, myListener);
    switch (AppPreferences.getTemplateType()) {
    case AppPreferences.TEMPLATE_PLAIN: plain.setSelected(true); break;
View Full Code Here

    JPanel buttons = new JPanel();
    buttons.add(clear);
    buttons.add(revert);
    buttons.add(enter);
   
    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints gc = new GridBagConstraints();
    setLayout(gb);
    gc.weightx = 1.0;
    gc.gridx = 0;
    gc.gridy = GridBagConstraints.RELATIVE;
    gc.fill = GridBagConstraints.BOTH;
   
    JPanel selectorPanel = selector.createPanel();
    gb.setConstraints(selectorPanel, gc); add(selectorPanel);
    gb.setConstraints(prettyView, gc); add(prettyView);
      Insets oldInsets = gc.insets;
      gc.insets = new Insets(10, 10, 0, 10);
      JScrollPane fieldPane = new JScrollPane(field,
          ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
          ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    gb.setConstraints(fieldPane, gc); add(fieldPane);
      gc.insets = oldInsets;
      gc.fill = GridBagConstraints.NONE;
      gc.anchor = GridBagConstraints.LINE_END;
    gb.setConstraints(buttons, gc); add(buttons);
      gc.fill = GridBagConstraints.BOTH;
    gb.setConstraints(error, gc); add(error);
   
    myListener.insertUpdate(null);
    setError(null);
  }
View Full Code Here

      Library lib, String initialValue) {
    JLabel label = new JLabel(Strings.get("circuitNamePrompt"));
    final JTextField field = new JTextField(15);
    field.setText(initialValue);
    JLabel error = new JLabel(" ");
    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints gc = new GridBagConstraints();
    JPanel strut = new JPanel(null);
    strut.setPreferredSize(new Dimension(3 * field.getPreferredSize().width / 2, 0));
    JPanel panel = new JPanel(gb);
    gc.gridx = 0;
    gc.gridy = GridBagConstraints.RELATIVE;
    gc.weightx = 1.0;
    gc.fill = GridBagConstraints.NONE;
    gc.anchor = GridBagConstraints.LINE_START;
    gb.setConstraints(label, gc); panel.add(label);
    gb.setConstraints(field, gc); panel.add(field);
    gb.setConstraints(error, gc); panel.add(error);
    gb.setConstraints(strut, gc); panel.add(strut);
    JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    pane.setInitialValue(field);
    JDialog dlog = pane.createDialog(frame, Strings.get("circuitNameDialogTitle"));
    dlog.addWindowFocusListener(new WindowFocusListener() {
View Full Code Here

      printerView = new JCheckBox();
      printerView.setSelected(true);

      // set up panel
      gridbag = new GridBagLayout();
      gbc = new GridBagConstraints();
      setLayout(gridbag);

      // now add components into panel
      gbc.gridy = 0;
View Full Code Here

  private JFileChooser chooser = JFileChoosers.create();
 
  public FilePanel(LogFrame frame) {
    super(frame);

    JPanel filePanel = new JPanel(new GridBagLayout());
    GridBagLayout gb = (GridBagLayout) filePanel.getLayout();
    GridBagConstraints gc = new GridBagConstraints();
      gc.fill = GridBagConstraints.HORIZONTAL;
    gb.setConstraints(fileLabel, gc);
    filePanel.add(fileLabel);
      gc.weightx = 1.0;
    gb.setConstraints(fileField, gc);
    filePanel.add(fileField);
      gc.weightx = 0.0;
    gb.setConstraints(selectButton, gc);
    filePanel.add(selectButton);
    fileField.setEditable(false);
    fileField.setEnabled(false);
   
    setLayout(new GridBagLayout());
    gb = (GridBagLayout) getLayout();
    gc = new GridBagConstraints();
      gc.gridx = 0;
      gc.weightx = 1.0;
      gc.gridy = GridBagConstraints.RELATIVE;
    JComponent glue;
    glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
    gb.setConstraints(enableLabel, gc);    add(enableLabel);
    gb.setConstraints(enableButton, gc);   add(enableButton);
    glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
      gc.fill = GridBagConstraints.HORIZONTAL;
    gb.setConstraints(filePanel, gc);      add(filePanel);
      gc.fill = GridBagConstraints.NONE;
    glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
    gb.setConstraints(headerCheckBox, gc); add(headerCheckBox);
    glue = new JPanel(); gc.weighty = 1.0; gb.setConstraints(glue, gc); add(glue); gc.weighty = 0.0;
   
    enableButton.addActionListener(listener);
    selectButton.addActionListener(listener);
    headerCheckBox.addActionListener(listener);
    modelChanged(null, getModel());
View Full Code Here

    this.init();
  }
 
  private void init() {
    this.setTitle(propertiesMgr.getValue("titleBuddyDialog"));   
    this.getContentPane().setLayout(new GridBagLayout());
       
    nameLabel = new JLabel(propertiesMgr.getValue("buddyName"));
    groupLabel = new JLabel(propertiesMgr.getValue("buddyGroup"));
    ok = new JButton(propertiesMgr.getValue("okForAddBuddy"));
    ok.addActionListener(this);
View Full Code Here

      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

TOP

Related Classes of java.awt.GridBagLayout$Segment

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.