Example usage for java.awt BorderLayout setVgap

List of usage examples for java.awt BorderLayout setVgap

Introduction

In this page you can find the example usage for java.awt BorderLayout setVgap.

Prototype

public void setVgap(int vgap) 

Source Link

Document

Sets the vertical gap between components.

Usage

From source file:es.emergya.ui.base.plugins.Option.java

public Option(String title, PluginType type, int order, String url, JComponent content) {
    setTitle(title);/*  ww  w.  jav  a2s .  c o m*/
    this.type = type;
    this.order = order;
    this.tip = title;

    if (url != null)
        this.icon = LogicConstants.getIcon(url);

    BorderLayout b = new BorderLayout();
    b.setVgap(10);
    b.setHgap(10);

    this.setLayout(b);

    super.tab = content;
    if (content != null)
        this.add(content, BorderLayout.CENTER);
}

From source file:com.sec.ose.osi.ui.frm.main.report.project.JPanProjectExplorer.java

private JPanel getJPanelSelectedPart() {
    if (jPanelSelectedPart == null) {
        jPanelSelectedPart = new JPanel();
        jPanelSelectedPart.setBorder(new TitledBorder("Selected Project(s)"));
        BorderLayout borderLayout = new BorderLayout();
        borderLayout.setVgap(10);
        jPanelSelectedPart.setLayout(borderLayout);
        jPanelSelectedPart.add(getJScrollPaneProjectList(), BorderLayout.CENTER);

    }//from w  ww  .  jav  a  2 s.c om
    return jPanelSelectedPart;
}

From source file:com.sec.ose.osi.ui.frm.main.report.project.JPanProjectExplorer.java

/**
 * This method initializes this/*from   w  ww  .j  av  a  2s. co m*/
 * 
 * @return void
 */
private void initialize() {
    BorderLayout borderLayout = new BorderLayout();
    borderLayout.setHgap(1);
    borderLayout.setVgap(1);
    this.setLayout(borderLayout);
    this.add(getJPanelSelectedPart(), BorderLayout.CENTER);

}

From source file:net.vanosten.dings.swing.SummaryView.java

protected void initializeMainP() {
    mainP = new JPanel();
    BorderLayout bl = new BorderLayout();
    bl.setVgap(DingsSwingConstants.SP_V_G);
    mainP.setLayout(bl);/*from  www .  j  ava2s .c  o m*/

    initComponents();
    initializeChartPropertiesPanel();

    mainP.add(chartP, BorderLayout.CENTER);
    mainP.add(chartPropertiesP, BorderLayout.PAGE_END);
}

From source file:MenuItemChooser.java

private void initGUI() {
    JPanel itemDetailsPanel = new JPanel();
    itemDetailsPanel.setLayout(new GridLayout(4, 2));
    itemDetailsPanel.setBackground(Color.WHITE);

    JLabel lbl = new JLabel("Item: ");
    itemDetailsPanel.add(lbl);//from   w  w  w  . j  a v a 2s.  c  om

    itemName = new JLabel("");
    itemDetailsPanel.add(itemName);

    lbl = new JLabel("Type: ");
    itemDetailsPanel.add(lbl);

    itemType = new JLabel("");
    itemDetailsPanel.add(itemType);

    lbl = new JLabel("Price: $ ");
    itemDetailsPanel.add(lbl);

    price = new JLabel("");
    itemDetailsPanel.add(price);

    lbl = new JLabel("Quantity: ");
    itemDetailsPanel.add(lbl);

    qty = new JTextField("0", 1);
    qty.addActionListener(this);
    qty.addFocusListener(this);
    itemDetailsPanel.add(qty);

    JPanel imgDescPanel = new JPanel(new BorderLayout());
    imgDescPanel.setBackground(Color.WHITE);
    image = new JLabel("");
    image.setHorizontalAlignment(SwingConstants.CENTER);
    image.setVerticalAlignment(SwingConstants.CENTER);

    imgDescPanel.add(image, BorderLayout.NORTH);

    desc = new JLabel("desc");
    imgDescPanel.add(desc, BorderLayout.SOUTH);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(Color.WHITE);
    next = new JButton("Next");
    next.addActionListener(this);
    buttonPanel.add(next);

    prev = new JButton("Previous");
    prev.addActionListener(this);
    buttonPanel.add(prev);

    order = new JButton("Order");
    order.addActionListener(this);
    buttonPanel.add(order);

    cancel = new JButton("Cancel / New");
    cancel.addActionListener(this);
    buttonPanel.add(cancel);

    close = new JButton("Close");
    close.addActionListener(this);
    close.setEnabled(false);
    buttonPanel.add(close);

    totalLbl = new JLabel("");
    totalLbl.setFont(new Font("Serif", Font.BOLD, 14));
    totalLbl.setForeground((Color.GREEN).darker());
    buttonPanel.add(totalLbl);

    BorderLayout bl = new BorderLayout();
    bl.setHgap(30);
    bl.setVgap(20);
    setLayout(bl);
    setBackground(Color.WHITE);
    add(itemDetailsPanel, BorderLayout.WEST);
    add(imgDescPanel, BorderLayout.EAST);
    add(buttonPanel, BorderLayout.SOUTH);
    TitledBorder title = BorderFactory.createTitledBorder("Choose Menu Items And Place Order");
    setBorder(title);

    loadMenuItem();
}

From source file:es.emergya.ui.gis.MapViewer.java

/**
 * Preferred constructor.// ww  w.j  a va 2s .  c  o m
 * 
 * @param title
 *            of the tab
 * @param type
 *            of plugin
 * @param order
 *            of tab
 * @param icon
 *            of tab
 * @param layers
 *            to be included on the mapView
 */
public MapViewer(String title, PluginType type, int order, String icon, List<MarkerLayer> layers) {
    setTitle(title);
    this.type = type;
    this.order = order;
    this.tip = title;

    if (icon != null)
        this.icon = LogicConstants.getIcon(icon);

    BorderLayout b = new BorderLayout();
    b.setVgap(10);
    b.setHgap(10);

    this.setLayout(b);

    // super.tab = content;
    // if (content != null)
    // this.add(content, BorderLayout.CENTER);
    ((BorderLayout) getLayout()).setHgap(0);
    ((BorderLayout) getLayout()).setVgap(0);
    Main.platform = Main.getPlatformHook();
    Main.platform.preStartupHook();
    Main.pref.init(true);
    Main.pref.putColor(marktr("scale"), Color.decode("#007f7f"));
    Main.pref.put("wmsplugin.alpha_channel", true);
    Main.preConstructorInit(new HashMap<String, Collection<String>>());
    new Main() {
    };

    for (MarkerLayer layer : layers) {
        this.mapView.addLayer(layer);
        layer.setMapView((MapView) this.mapView);
    }
}

From source file:org.jdal.swing.table.TablePanel.java

/** 
 * Creates new TablePanel// www .j a  va2 s .  co m
 */
public TablePanel() {
    BorderLayout layout = new BorderLayout();
    layout.setVgap(10);
    layout.setHgap(10);
    setLayout(layout);
}

From source file:io.github.jeremgamer.editor.panels.components.PanelsPanel.java

public PanelsPanel(JFrame frame, final PanelSave ps) {
    this.ps = ps;
    this.frame = frame;
    this.setSize(new Dimension(395, frame.getHeight() - 27 - 23));
    this.setLocation(300, 0);
    this.setBorder(BorderFactory.createTitledBorder("Edition du panneau"));

    JPanel content = new JPanel();
    JScrollPane scroll = new JScrollPane(content);
    scroll.getVerticalScrollBar().setUnitIncrement(Editor.SCROLL_SPEED);
    scroll.setBorder(null);/*from ww w .j a  va  2  s .  com*/
    content.setLayout(new BoxLayout(content, BoxLayout.PAGE_AXIS));
    scroll.setPreferredSize(new Dimension(382, frame.getHeight() - 27 - 46 - 20));

    JPanel namePanel = new JPanel();
    name.setPreferredSize(new Dimension(this.getWidth() - 280, 30));
    name.setEditable(false);
    namePanel.add(new JLabel("Nom :"));
    namePanel.add(name);
    namePanel.add(Box.createRigidArea(new Dimension(10, 1)));
    layout.addItem("Basique");
    layout.addItem("Bordures");
    layout.addItem("Ligne");
    layout.addItem("Colonne");
    layout.addItem("Grille");
    layout.addItem("Empil");
    layout.setPreferredSize(new Dimension(110, 30));
    layout.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            cl.show(advanced, listContent[combo.getSelectedIndex()]);
            ps.set("layout", combo.getSelectedIndex());
            ActionPanel.updateLists();
        }

    });
    namePanel.add(new JLabel("Disposition :"));
    namePanel.add(layout);
    namePanel.setPreferredSize(new Dimension(365, 50));
    namePanel.setMaximumSize(new Dimension(365, 50));
    content.add(namePanel);

    advanced.setPreferredSize(new Dimension(365, 300));
    advanced.setMaximumSize(new Dimension(365, 300));
    advanced.add(ble, listContent[0]);
    advanced.add(brdle, listContent[1]);
    advanced.add(lle, listContent[2]);
    advanced.add(rle, listContent[3]);
    advanced.add(gle, listContent[4]);
    advanced.add(cle, listContent[5]);

    content.add(advanced);

    topBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            ps.set("border.top", combo.getSelectedItem());
        }

    });
    leftBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            ps.set("border.left", combo.getSelectedItem());
        }

    });
    centerBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            ps.set("border.center", combo.getSelectedItem());
        }

    });
    rightBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            ps.set("border.right", combo.getSelectedItem());
        }

    });
    bottomBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            ps.set("border.bottom", combo.getSelectedItem());
        }

    });

    JPanel prefSize = new JPanel();
    prefSize.setPreferredSize(new Dimension(365, 110));
    prefSize.setMaximumSize(new Dimension(365, 110));
    prefSize.setBorder(BorderFactory.createTitledBorder("Taille prfre"));
    JPanel prefSizePanel = new JPanel();
    prefSizePanel.setLayout(new GridLayout(2, 4));
    prefSizePanel.setPreferredSize(new Dimension(300, 55));
    prefSizePanel.setMaximumSize(new Dimension(300, 55));
    prefSizePanel.add(prefSizeEnabled);
    prefSizePanel.add(new JLabel(""));
    prefSizePanel.add(new JLabel(""));
    prefSizePanel.add(new JLabel("(en pixels)"));
    prefSizePanel.add(new JLabel("Largeur :"));
    prefSizePanel.add(prefWidth);
    prefSizePanel.add(new JLabel("Hauteur :"));
    prefSizePanel.add(prefHeight);
    prefWidth.setEnabled(false);
    prefHeight.setEnabled(false);
    prefSizeEnabled.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            JCheckBox check = (JCheckBox) event.getSource();
            ps.set("preferredSize", check.isSelected());
            prefWidth.setEnabled(check.isSelected());
            prefHeight.setEnabled(check.isSelected());
        }
    });
    prefWidth.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent event) {
            JSpinner spinner = (JSpinner) event.getSource();
            ps.set("preferredWidth", spinner.getValue());
        }
    });
    prefHeight.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent event) {
            JSpinner spinner = (JSpinner) event.getSource();
            ps.set("preferredHeight", spinner.getValue());
        }
    });
    prefSize.add(prefSizePanel);

    content.add(prefSize);

    JPanel insetsPanel = new JPanel();
    insetsPanel.setBorder(BorderFactory.createTitledBorder("carts"));
    insetsPanel.setPreferredSize(new Dimension(365, 100));
    insetsPanel.setMaximumSize(new Dimension(365, 100));

    JPanel insetsContent = new JPanel();
    insetsContent.setLayout(new BoxLayout(insetsContent, BoxLayout.PAGE_AXIS));

    JPanel insetInput = new JPanel();
    insetInput.setLayout(new GridLayout(2, 4));
    insetInput.add(insetsEnabled);
    insetInput.add(new JLabel(""));
    insetInput.add(new JLabel(""));
    insetInput.add(new JLabel("(en pixels)"));
    insetInput.add(new JLabel("Horizontaux :"));
    insetInput.add(insetHz);
    insetInput.add(new JLabel("Verticaux :"));
    insetInput.add(insetVt);

    insetsEnabled.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            JCheckBox check = (JCheckBox) event.getSource();
            if (check.isSelected()) {
                insetHz.setEnabled(true);
                insetVt.setEnabled(true);
                ps.set("insets", true);
            } else {
                insetHz.setEnabled(true);
                insetVt.setEnabled(true);
                ps.set("insets", false);
            }
        }

    });

    insetHz.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent event) {
            JSpinner spinner = (JSpinner) event.getSource();
            ps.set("insets.horizontal", spinner.getValue());
        }
    });
    insetVt.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent event) {
            JSpinner spinner = (JSpinner) event.getSource();
            ps.set("insets.vertical", spinner.getValue());
        }
    });

    insetsContent.add(insetInput);
    insetsPanel.add(insetsContent);

    content.add(insetsPanel);

    JPanel web = new JPanel();
    web.setPreferredSize(new Dimension(365, 100));
    web.setMaximumSize(new Dimension(365, 100));
    web.setBorder(BorderFactory.createTitledBorder("Page Web"));

    JPanel webContent = new JPanel();
    webContent.setLayout(new BorderLayout());
    webContent.add(webEnabled, BorderLayout.NORTH);
    webEnabled.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JCheckBox check = (JCheckBox) e.getSource();
            ps.set("web", check.isSelected());
            if (check.isSelected() == true) {
                layout.setSelectedIndex(0);
                layout.setEnabled(false);
                ble.removeAllComponents();
                ble.disableComponents();
                adress.setEnabled(true);
            } else {
                ble.enableComponents();
                layout.setEnabled(true);
                adress.setEnabled(false);
            }
        }
    });
    JPanel webInput = new JPanel();
    webInput.add(new JLabel("Adresse :"));
    adress.setPreferredSize(new Dimension(250, 30));
    CaretListener caretUpdate = new CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent e) {
            JTextField text = (JTextField) e.getSource();
            ps.set("web.adress", text.getText());
        }
    };
    adress.addCaretListener(caretUpdate);
    webInput.add(adress);
    webContent.add(webInput, BorderLayout.CENTER);

    web.add(webContent);

    JPanel background = new JPanel();
    BorderLayout bLayout = new BorderLayout();
    bLayout.setVgap(12);
    background.setLayout(bLayout);
    background.setBorder(BorderFactory.createTitledBorder("Couleur de fond"));
    background.setPreferredSize(new Dimension(365, 210));
    background.setMaximumSize(new Dimension(365, 210));
    cp.setPreferredSize(new Dimension(347, 145));
    cp.setMaximumSize(new Dimension(347, 145));
    opaque.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JCheckBox check = (JCheckBox) e.getSource();
            ps.set("background.opaque", check.isSelected());
            cp.enableComponents(check.isSelected());
        }
    });
    background.add(opaque, BorderLayout.NORTH);
    background.add(cp, BorderLayout.CENTER);

    JPanel image = new JPanel();
    image.setBorder(BorderFactory.createTitledBorder("Image de fond"));
    image.setPreferredSize(new Dimension(365, 125));
    image.setMaximumSize(new Dimension(365, 125));
    image.setLayout(new BorderLayout());
    try {
        remove = new JButton(new ImageIcon(ImageIO.read(ImageGetter.class.getResource("remove.png"))));
    } catch (IOException e) {
        e.printStackTrace();
    }
    remove.setEnabled(false);
    remove.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            File img = new File(
                    "projects/" + Editor.getProjectName() + "/panels/" + name.getText() + "/background.png");
            if (img.exists()) {
                img.delete();
            }
            browseImage.setEnabled(true);
        }

    });
    JPanel top = new JPanel();
    browseImage.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JButton button = (JButton) e.getSource();
            String path = null;
            JFileChooser chooser = new JFileChooser(Editor.lastPath);
            FileNameExtensionFilter filter = new FileNameExtensionFilter("Images", "jpg", "png", "gif", "jpeg",
                    "bmp");
            chooser.setFileFilter(filter);
            chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            int option = chooser.showOpenDialog(null);
            if (option == JFileChooser.APPROVE_OPTION) {
                path = chooser.getSelectedFile().getAbsolutePath();
                Editor.lastPath = chooser.getSelectedFile().getParent();
                copyImage(new File(path), "background.png");
                nameBackground.setText(new File(path).getName());
                ps.set("background.image", new File(path).getName());
                button.setEnabled(false);
                size.setEnabled(true);
                size2.setEnabled(true);
                remove.setEnabled(true);
            }
        }

    });
    bg.add(size);
    bg.add(size2);
    JPanel sizePanel = new JPanel();
    sizePanel.setLayout(new BoxLayout(sizePanel, BoxLayout.PAGE_AXIS));
    size.setEnabled(false);
    size2.setEnabled(false);
    sizePanel.add(size);
    sizePanel.add(size2);
    size.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            ps.set("background.size", 0);
        }

    });
    size2.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            ps.set("background.size", 1);
        }

    });
    top.add(browseImage);
    top.add(sizePanel);

    remove.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            JButton button = (JButton) event.getSource();
            new File("projects/" + Editor.getProjectName() + "/panels/" + name.getText() + "/background.png")
                    .delete();
            nameBackground.setText("");
            ps.set("background.image", "");
            button.setEnabled(false);
        }

    });
    nameBackground.setFont(new Font("Sans Serif", Font.PLAIN, 15));
    JPanel center = new JPanel(new BorderLayout());
    center.add(nameBackground, BorderLayout.CENTER);
    center.add(remove, BorderLayout.EAST);

    image.add(top, BorderLayout.NORTH);
    image.add(center, BorderLayout.CENTER);

    content.add(web);
    content.add(background);
    content.add(image);

    this.add(scroll);
}

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

/** initializes the specimen details view pane.
*  Note, contains comments indicating how to enable visual designer with this class. 
*///  w w  w. j ava  2s .  c o m
private void initialize() {
    BorderLayout borderLayout = new BorderLayout();
    borderLayout.setHgap(0);
    borderLayout.setVgap(0);
    this.setLayout(borderLayout);
    this.setSize(new Dimension(594, 1000));
    //this.setPreferredSize(new Dimension(490, 917));
    this.add(getJTextFieldStatus(), BorderLayout.SOUTH);

    // Un-comment this line to use design tool.
    //    this.add(getJPanel(), BorderLayout.CENTER);

    // Comment this block out to use design tool.
    //   see also getCbTypeStatus

    if (Singleton.getSingletonInstance().getProperties().getProperties()
            .getProperty(ImageCaptureProperties.KEY_DETAILS_SCROLL)
            .equals(ImageCaptureProperties.VALUE_DETAILS_SCROLL_FORCE_ON)) {
        JScrollPane scrollPane = new JScrollPane(getJPanel(), JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        this.add(scrollPane, BorderLayout.CENTER);
    } else {
        this.add(getJPanel(), BorderLayout.CENTER);
    }
    //**       

}

From source file:org.jimcat.gui.perspective.detail.DetailSideBar.java

/**
 * creates the preview head/*from   www . j  a va2 s.  c  om*/
 * 
 * @return the JPanel for preview purposes
 */
private JPanel createPreviewPanel() {
    // preview panel
    JPanel preview = new JPanel();
    BorderLayout previewLayout = new BorderLayout();
    previewLayout.setHgap(5);
    previewLayout.setVgap(5);
    preview.setLayout(new BorderLayout());
    preview.setOpaque(true);

    image = new ImageViewer();
    image.setMinimumSize(PREVIEW_DIMENSION);
    image.setPreferredSize(PREVIEW_DIMENSION);
    image.setMaximumSize(PREVIEW_DIMENSION);
    image.setBorder(new EmptyBorder(5, 5, 5, 5));
    image.setOpaque(false);
    image.addMouseListener(new PreviewImageDoubleClickListener());
    preview.add(image, BorderLayout.CENTER);

    return preview;
}