Example usage for java.awt BorderLayout setHgap

List of usage examples for java.awt BorderLayout setHgap

Introduction

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

Prototype

public void setHgap(int hgap) 

Source Link

Document

Sets the horizontal 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);//  w  ww.j ava 2 s .  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

/**
 * This method initializes this/* ww  w  . j  a  va2 s .c  o 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: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);/* w w  w  .j  a va2  s. 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:org.gvsig.remotesensing.profiles.gui.ZProfileOptionsPanel.java

public ZProfileOptionsPanel(ProfilePanel mainPanel) {
    super();//from www  .j a v a  2 s.c o m
    this.mapControl = mainPanel.getMapControl();
    this.mainPanel = mainPanel;
    this.fLayer = mainPanel.getFlayer();
    BorderLayout bd = new BorderLayout();
    listener = new ZProfileOptionsListener(this);
    bd.setHgap(1);
    setLayout(bd);
    add(getTable(), BorderLayout.CENTER);
    add(getControlPanel(), BorderLayout.WEST);
    previousTool = mapControl.getCurrentTool();
    initialize();
}

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

/**
 * Preferred constructor./*from ww w  .  j  a v  a2 s. co  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/*from   www . ja v  a  2  s  . c o m*/
 */
public TablePanel() {
    BorderLayout layout = new BorderLayout();
    layout.setVgap(10);
    layout.setHgap(10);
    setLayout(layout);
}

From source file:org.gvsig.remotesensing.profiles.gui.LineProfileOptionsPanel.java

/**
 * Constructor/*from  ww  w  .j  av  a 2 s  .  c o m*/
 * */
public LineProfileOptionsPanel(ProfilePanel mainPanel) {
    super();
    this.mapControl = mainPanel.getMapControl();
    this.mainPanel = mainPanel;
    try {
        this.fLayer = mainPanel.getFlayer().cloneLayer();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    BorderLayout bd = new BorderLayout();
    listener = new LineProfileOptionsListener(this);
    bd.setHgap(1);
    setLayout(bd);
    initialize();
    add(getTable(), BorderLayout.CENTER);
    add(getControlPanel(), BorderLayout.WEST);
    previousTool = mapControl.getCurrentTool();
}

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  a va 2s  .  co 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  .java 2s  .co m
 * 
 * @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;
}

From source file:org.openmicroscopy.shoola.agents.fsimporter.chooser.LocationDialog.java

/**
 * Builds and lays out the UI./*w w w. ja v  a  2s  .  c o  m*/
 */
private void layoutUI() {
    BorderLayout layout = new BorderLayout();
    layout.setHgap(UI_GAP);
    layout.setVgap(UI_GAP);

    JPanel mainPanel = new JPanel(layout);
    mainPanel.add(buildGroupSelectionPanel(), BorderLayout.NORTH);
    mainPanel.add(buildDataTypeTabbedPane(), BorderLayout.CENTER);
    mainPanel.add(buildLowerButtonPanel(), BorderLayout.SOUTH);

    TableLayout containerLayout = createTableLayout(TABLE_GAP);
    Container contentPane = this.getContentPane();
    contentPane.setLayout(containerLayout);
    contentPane.add(mainPanel, "1, 1");

    // resize the window to minimum size
    setMinimumSize();
}