<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.GridBagLayout
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.GridBagConstraints.html#_top_">Previous</a>  <a href="java.awt.GridLayout.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.GridBagLayout
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.awt.GridBagLayout
</pre>
<hr>
<dl>
  <dt> public class <b>GridBagLayout</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.awt.LayoutManager2.html#_top_">LayoutManager2</a>, <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
The <code>GridBagLayout</code> class is a flexible layout 
 manager that aligns components vertically and horizontally,
 without requiring that the components be of the same size.
 Each <code>GridBagLayout</code> object maintains a dynamic 
 rectangular grid of cells, with each component occupying 
 one or more cells, called its <em>display area</em>.
 <p>
 Each component managed by a grid bag layout is associated 
 with an instance of 
 <a href="java.awt.GridBagConstraints.html"><code>GridBagConstraints</code></a> 
 that specifies how the component is laid out within its display area.
 <p>
 How a <code>GridBagLayout</code> object places a set of components
 depends on the <code>GridBagConstraints</code> object associated 
 with each component, and on the minimum size 
 and the preferred size of the components' containers.
 <p>
 To use a grid bag layout effectively, you must customize one or more 
 of the <code>GridBagConstraints</code> objects that are associated 
 with its components. You customize a <code>GridBagConstraints</code> 
 object by setting one or more of its instance variables:
 <p>
 <dl>
 <dt><a href="java.awt.GridBagConstraints.html#gridx"><code>gridx</code></a>,
 <a href="java.awt.GridBagConstraints.html#gridy"><code>gridy</code></a>
 <dd>Specifies the cell at the upper left of the component's display area,
 where the upper-left-most cell has address 
 <code>gridx&nbsp;=&nbsp;0</code>, 
 <code>gridy&nbsp;=&nbsp;0</code>. 
 Use <code>GridBagConstraints.RELATIVE</code> (the default value)
 to specify that the component be just placed
 just to the right of (for <code>gridx</code>)
 or just below (for <code>gridy</code>)
 the component that was added to the container
 just before this component was added.
 <dt><a href="java.awt.GridBagConstraints.html#gridwidth"><code>gridwidth</code></a>,
 <a href="java.awt.GridBagConstraints.html#gridheight"><code>gridheight</code></a>
 <dd>Specifies the number of cells in a row (for <code>gridwidth</code>)
 or column (for <code>gridheight</code>)
 in the component's display area.
 The default value is 1.
 Use <code>GridBagConstraints.REMAINDER</code> to specify 
 that the component be the last one in its row (for <code>gridwidth</code>)
 or column (for <code>gridheight</code>).
 Use <code>GridBagConstraints.RELATIVE</code> to specify 
 that the component be the next to last one
 in its row (for <code>gridwidth</code>) 
 or column (for <code>gridheight</code>).
 <dt><a href="java.awt.GridBagConstraints.html#fill"><code>fill</code></a>
 <dd>Used when the component's display area
 is larger than the component's requested size
 to determine whether (and how) to resize the component.
 Possible values are
 <code>GridBagConstraints.NONE</code> (the default),
 <code>GridBagConstraints.HORIZONTAL</code> 
 (make the component wide enough to fill its display area
 horizontally, but don't change its height),
 <code>GridBagConstraints.VERTICAL</code> 
 (make the component tall enough to fill its display area 
 vertically, but don't change its width), and 
 <code>GridBagConstraints.BOTH</code> 
 (make the component fill its display area entirely). 
 <dt><a href="java.awt.GridBagConstraints.html#ipadx"><code>ipadx</code></a>,
 <a href="java.awt.GridBagConstraints.html#ipady"><code>ipady</code></a>
 <dd>Specifies the component's internal padding within the layout, 
 how much to add to the minimum size of the component.
 The width of the component will be at least its minimum width 
 plus <code>(ipadx&nbsp;*&nbsp;2)</code> pixels (since the padding 
 applies to both sides of the component). Similarly, the height of 
 the component will be at least the minimum height plus 
 <code>(ipady&nbsp;*&nbsp;2)</code> pixels.
 <dt><a href="java.awt.GridBagConstraints.html#insets"><code>insets</code></a>
 <dd>Specifies the component's external padding, the minimum
 amount of space between the component and the edges of its display area.
 <dt><a href="java.awt.GridBagConstraints.html#anchor"><code>anchor</code></a>
 <dd>Used when the component is smaller than its display area
 to determine where (within the display area) to place the component.
 Valid values are 
 <code>GridBagConstraints.CENTER</code> (the default), 
 <code>GridBagConstraints.NORTH</code>, 
 <code>GridBagConstraints.NORTHEAST</code>, 
 <code>GridBagConstraints.EAST</code>, 
 <code>GridBagConstraints.SOUTHEAST</code>, 
 <code>GridBagConstraints.SOUTH</code>, 
 <code>GridBagConstraints.SOUTHWEST</code>, 
 <code>GridBagConstraints.WEST</code>, and 
 <code>GridBagConstraints.NORTHWEST</code>. 
 <dt><a href="java.awt.GridBagConstraints.html#weightx"><code>weightx</code></a>,
 <a href="java.awt.GridBagConstraints.html#weighty"><code>weighty</code></a>
 <dd>Used to determine how to distribute space, which is 
 important for specifying resizing behavior.
 Unless you specify a weight for at least one component 
 in a row (<code>weightx</code>) and column (<code>weighty</code>), 
 all the components clump together in the center of their container.
 This is because when the weight is zero (the default),
 the <code>GridBagLayout</code> object puts any extra space 
 between its grid of cells and the edges of the container.
 </dl>
 <p>
 The following figure shows ten components (all buttons)
 managed by a grid bag layout:
 <p>
 <img src="images-awt/GridBagLayout-1.gif" 
 ALIGN=center HSPACE=10 VSPACE=7>
 <p>
 Each of the ten components has the <code>fill</code> field 
 of its associated <code>GridBagConstraints</code> object 
 set to <code>GridBagConstraints.BOTH</code>.
 In addition, the components have the following non-default constraints:
 <p>
 <ul>
 <li>Button1, Button2, Button3: <code>weightx&nbsp;=&nbsp;1.0</code> 
 <li>Button4: <code>weightx&nbsp;=&nbsp;1.0</code>, 
 <code>gridwidth&nbsp;=&nbsp;GridBagConstraints.REMAINDER</code> 
 <li>Button5: <code>gridwidth&nbsp;=&nbsp;GridBagConstraints.REMAINDER</code> 
 <li>Button6: <code>gridwidth&nbsp;=&nbsp;GridBagConstraints.RELATIVE</code> 
 <li>Button7: <code>gridwidth&nbsp;=&nbsp;GridBagConstraints.REMAINDER</code> 
 <li>Button8: <code>gridheight&nbsp;=&nbsp;2</code>, 
 <code>weighty&nbsp;=&nbsp;1.0</code> 
 <li>Button9, Button 10: 
 <code>gridwidth&nbsp;=&nbsp;GridBagConstraints.REMAINDER</code> 
 </ul>
 <p>
 Here is the code that implements the example shown above:
 <p>
 <hr><blockquote><pre>
 import java.awt.*;
 import java.util.*;
 import java.applet.Applet;
 public class GridBagEx1 extends Applet {
     protected void makebutton(String name,
                               GridBagLayout gridbag,
                               GridBagConstraints c) {
         Button button = new Button(name);
         gridbag.setConstraints(button, c);
         add(button);
     }
     public void init() {
         GridBagLayout gridbag = new GridBagLayout();
         GridBagConstraints c = new GridBagConstraints();
         setFont(new Font("Helvetica", Font.PLAIN, 14));
         setLayout(gridbag);
         c.fill = GridBagConstraints.BOTH;
         c.weightx = 1.0;
         makebutton("Button1", gridbag, c);
         makebutton("Button2", gridbag, c);
         makebutton("Button3", gridbag, c);
     	   c.gridwidth = GridBagConstraints.REMAINDER; //end row
         makebutton("Button4", gridbag, c);
         c.weightx = 0.0;		   //reset to the default
         makebutton("Button5", gridbag, c); //another row
 	   c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last in row
         makebutton("Button6", gridbag, c);
 	   c.gridwidth = GridBagConstraints.REMAINDER; //end row
         makebutton("Button7", gridbag, c);
 	   c.gridwidth = 1;	   	   //reset to the default
 	   c.gridheight = 2;
         c.weighty = 1.0;
         makebutton("Button8", gridbag, c);
         c.weighty = 0.0;		   //reset to the default
 	   c.gridwidth = GridBagConstraints.REMAINDER; //end row
 	   c.gridheight = 1;		   //reset to the default
         makebutton("Button9", gridbag, c);
         makebutton("Button10", gridbag, c);
         setSize(300, 100);
     }
     public static void main(String args[]) {
 	   Frame f = new Frame("GridBag Layout Example");
 	   GridBagEx1 ex1 = new GridBagEx1();
 	   ex1.init();
 	   f.add("Center", ex1);
 	   f.pack();
 	   f.setSize(f.getPreferredSize());
 	   f.show();
     }
 }
 </pre></blockquote><hr>
 <p>
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#columnWeights"><b>columnWeights</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#columnWidths"><b>columnWidths</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#comptable"><b>comptable</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#defaultConstraints"><b>defaultConstraints</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#layoutInfo"><b>layoutInfo</b></a>
  <dd> 
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#MAXGRIDSIZE"><b>MAXGRIDSIZE</b></a>
  <dd>  The maximum number of grid positions (both horizontally and 
 vertically) that can be laid out by the grid bag layout.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#MINSIZE"><b>MINSIZE</b></a>
  <dd>  The smallest grid that can be laid out by the grid bag layout.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PREFERREDSIZE"><b>PREFERREDSIZE</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#rowHeights"><b>rowHeights</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#rowWeights"><b>rowWeights</b></a>
  <dd> 
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#GridBagLayout()"><b>GridBagLayout</b></a>()
  <dd>  Creates a grid bag layout manager.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addLayoutComponent(java.awt.Component, java.lang.Object)"><b>addLayoutComponent</b></a>(Component, Object)
  <dd>  Adds the specified component to the layout, using the specified
 constraint object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addLayoutComponent(java.lang.String, java.awt.Component)"><b>addLayoutComponent</b></a>(String, Component)
  <dd>  Adds the specified component with the specified name to the layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#AdjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle)"><b>AdjustForGravity</b></a>(GridBagConstraints, Rectangle)
  <dd> 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#ArrangeGrid(java.awt.Container)"><b>ArrangeGrid</b></a>(Container)
  <dd> 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getConstraints(java.awt.Component)"><b>getConstraints</b></a>(Component)
  <dd>  Gets the constraints for the specified component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutAlignmentX(java.awt.Container)"><b>getLayoutAlignmentX</b></a>(Container)
  <dd>  Returns the alignment along the x axis.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutAlignmentY(java.awt.Container)"><b>getLayoutAlignmentY</b></a>(Container)
  <dd>  Returns the alignment along the y axis.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutDimensions()"><b>getLayoutDimensions</b></a>()
  <dd>  Determines column widths and row heights for the layout grid.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#GetLayoutInfo(java.awt.Container, int)"><b>GetLayoutInfo</b></a>(Container, int)
  <dd>  Print the layout constraints.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutOrigin()"><b>getLayoutOrigin</b></a>()
  <dd>  Determines the origin of the layout grid.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutWeights()"><b>getLayoutWeights</b></a>()
  <dd>  Determines the weights of the layout grid's columns and rows.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#GetMinSize(java.awt.Container, java.awt.GridBagLayoutInfo)"><b>GetMinSize</b></a>(Container, GridBagLayoutInfo)
  <dd> 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#invalidateLayout(java.awt.Container)"><b>invalidateLayout</b></a>(Container)
  <dd>  Invalidates the layout, indicating that if the layout manager
 has cached information it should be discarded.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#layoutContainer(java.awt.Container)"><b>layoutContainer</b></a>(Container)
  <dd> 
 Lays out the specified container using this grid bag layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#location(int, int)"><b>location</b></a>(int, int)
  <dd>  Determines which cell in the layout grid contains the point
 specified by <code>(x,&nbsp;y)</code>.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#lookupConstraints(java.awt.Component)"><b>lookupConstraints</b></a>(Component)
  <dd>  Retrieves the constraints for the specified component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#maximumLayoutSize(java.awt.Container)"><b>maximumLayoutSize</b></a>(Container)
  <dd>  Returns the maximum dimensions for this layout given the components
 in the specified target container.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#minimumLayoutSize(java.awt.Container)"><b>minimumLayoutSize</b></a>(Container)
  <dd>  Determines the minimum size of the <code>target</code> container 
 using this grid bag layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#preferredLayoutSize(java.awt.Container)"><b>preferredLayoutSize</b></a>(Container)
  <dd> 
 Determines the preferred size of the <code>target</code> 
 container using this grid bag layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeLayoutComponent(java.awt.Component)"><b>removeLayoutComponent</b></a>(Component)
  <dd>  Removes the specified component from this layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setConstraints(java.awt.Component, java.awt.GridBagConstraints)"><b>setConstraints</b></a>(Component, GridBagConstraints)
  <dd>  Sets the constraints for the specified component in this layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string representation of this grid bag layout's values.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="MAXGRIDSIZE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>MAXGRIDSIZE</b>
<pre>
 protected static final int MAXGRIDSIZE
</pre>
<dl>
  <dd> The maximum number of grid positions (both horizontally and 
 vertically) that can be laid out by the grid bag layout.<p>
</dl>
<a name="MINSIZE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>MINSIZE</b>
<pre>
 protected static final int MINSIZE
</pre>
<dl>
  <dd> The smallest grid that can be laid out by the grid bag layout.<p>
</dl>
<a name="PREFERREDSIZE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>PREFERREDSIZE</b>
<pre>
 protected static final int PREFERREDSIZE
</pre>
<a name="comptable"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>comptable</b>
<pre>
 protected <a href="java.util.Hashtable.html#_top_">Hashtable</a> comptable
</pre>
<a name="defaultConstraints"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>defaultConstraints</b>
<pre>
 protected <a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a> defaultConstraints
</pre>
<a name="layoutInfo"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>layoutInfo</b>
<pre>
 protected GridBagLayoutInfo layoutInfo
</pre>
<a name="columnWidths"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>columnWidths</b>
<pre>
 public int columnWidths[]
</pre>
<a name="rowHeights"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>rowHeights</b>
<pre>
 public int rowHeights[]
</pre>
<a name="columnWeights"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>columnWeights</b>
<pre>
 public double columnWeights[]
</pre>
<a name="rowWeights"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>rowWeights</b>
<pre>
 public double rowWeights[]
</pre>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="GridBagLayout"></a>
<a name="GridBagLayout()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>GridBagLayout</b>
<pre>
 public GridBagLayout()
</pre>
<dl>
  <dd> Creates a grid bag layout manager.
<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setConstraints(java.awt.Component, java.awt.GridBagConstraints)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setConstraints"><b>setConstraints</b></a>
<pre>
 public void setConstraints(<a href="java.awt.Component.html#_top_">Component</a> comp,
                            <a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a> constraints)
</pre>
<dl>
  <dd> Sets the constraints for the specified component in this layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be modified.
    <dd> constraints - the constraints to be applied.
  </dl></dd>
</dl>
<a name="getConstraints(java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getConstraints"><b>getConstraints</b></a>
<pre>
 public <a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a> getConstraints(<a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Gets the constraints for the specified component.  A copy of
 the actual <code>GridBagConstraints</code> object is returned.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be queried.
    <dt> <b>Returns:</b>
    <dd> the constraint for the specified component in this
                  grid bag layout; a copy of the actual constraint 
                  object is returned.
  </dl></dd>
</dl>
<a name="lookupConstraints(java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="lookupConstraints"><b>lookupConstraints</b></a>
<pre>
 protected <a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a> lookupConstraints(<a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Retrieves the constraints for the specified component.  
 The return value is not a copy, but is the actual 
 <code>GridBagConstraints</code> object used by the layout mechanism.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be queried
    <dt> <b>Returns:</b>
    <dd> the contraints for the specified component.
  </dl></dd>
</dl>
<a name="getLayoutOrigin()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutOrigin"><b>getLayoutOrigin</b></a>
<pre>
 public <a href="java.awt.Point.html#_top_">Point</a> getLayoutOrigin()
</pre>
<dl>
  <dd> Determines the origin of the layout grid. 
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the origin of the cell in the top-left
                    corner of the layout grid.
  </dl></dd>
</dl>
<a name="getLayoutDimensions()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutDimensions"><b>getLayoutDimensions</b></a>
<pre>
 public int[][] getLayoutDimensions()
</pre>
<dl>
  <dd> Determines column widths and row heights for the layout grid.
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an array of two arrays, containing the widths
                       of the layout columns and
                       the heights of the layout rows.
  </dl></dd>
</dl>
<a name="getLayoutWeights()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutWeights"><b>getLayoutWeights</b></a>
<pre>
 public double[][] getLayoutWeights()
</pre>
<dl>
  <dd> Determines the weights of the layout grid's columns and rows.
 Weights are used to calculate how much a given column or row
 stretches beyond its preferred size, if the layout has extra
 room to fill.
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an array of two arrays, representing the
                    horizontal weights of the layout columns 
                    and the vertical weights of the layout rows.
  </dl></dd>
</dl>
<a name="location(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="location"><b>location</b></a>
<pre>
 public <a href="java.awt.Point.html#_top_">Point</a> location(int x,
                       int y)
</pre>
<dl>
  <dd> Determines which cell in the layout grid contains the point
 specified by <code>(x,&nbsp;y)</code>. Each cell is identified 
 by its column index (ranging from 0 to the number of columns 
 minus 1) and its row index (ranging from 0 to the number of 
 rows minus 1).  
 <p>
 If the <code>(x,&nbsp;y)</code> point lies 
 outside the grid, the following rules are used.  
 The column index is returned as zero if <code>x</code> lies to the
 left of the layout, and as the number of columns if <code>x</code> lies
 to the right of the layout. The row index is returned as zero
 if <code>y</code> lies above the layout, 
 and as the number of rows if <code>y</code> lies
 below the layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> x - the <i>x</i> coordinate of a point.
    <dd> y - the <i>y</i> coordinate of a point.
    <dt> <b>Returns:</b>
    <dd> an ordered pair of indexes that indicate which cell
             in the layout grid contains the point 
             (<i>x</i>,&nbsp;<i>y</i>).
  </dl></dd>
</dl>
<a name="addLayoutComponent(java.lang.String, java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addLayoutComponent"><b>addLayoutComponent</b></a>
<pre>
 public void addLayoutComponent(<a href="java.lang.String.html#_top_">String</a> name,
                                <a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Adds the specified component with the specified name to the layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the component.
    <dd> comp - the component to be added.
  </dl></dd>
</dl>
<a name="addLayoutComponent(java.awt.Component, java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addLayoutComponent"><b>addLayoutComponent</b></a>
<pre>
 public void addLayoutComponent(<a href="java.awt.Component.html#_top_">Component</a> comp,
                                <a href="java.lang.Object.html#_top_">Object</a> constraints)
</pre>
<dl>
  <dd> Adds the specified component to the layout, using the specified
 constraint object.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be added.
    <dd> constraints - an object that determines how
                              the component is added to the layout.
  </dl></dd>
</dl>
<a name="removeLayoutComponent(java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeLayoutComponent"><b>removeLayoutComponent</b></a>
<pre>
 public void removeLayoutComponent(<a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Removes the specified component from this layout. 
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be removed.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#remove(java.awt.Component)">remove</a>, <a href="java.awt.Container.html#removeAll()">removeAll</a>
  </dl></dd>
</dl>
<a name="preferredLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="preferredLayoutSize"><b>preferredLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> preferredLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Determines the preferred size of the <code>target</code> 
 container using this grid bag layout. 
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the container in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#getPreferredSize">getPreferredSize</a>
  </dl></dd>
</dl>
<a name="minimumLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="minimumLayoutSize"><b>minimumLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> minimumLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Determines the minimum size of the <code>target</code> container 
 using this grid bag layout. 
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the container in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#doLayout">doLayout</a>
  </dl></dd>
</dl>
<a name="maximumLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="maximumLayoutSize"><b>maximumLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> maximumLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Returns the maximum dimensions for this layout given the components
 in the specified target container.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the component which needs to be laid out
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>, <a href="#minimumLayoutSize">minimumLayoutSize</a>, <a href="#preferredLayoutSize">preferredLayoutSize</a>
  </dl></dd>
</dl>
<a name="getLayoutAlignmentX(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutAlignmentX"><b>getLayoutAlignmentX</b></a>
<pre>
 public float getLayoutAlignmentX(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Returns the alignment along the x axis.  This specifies how
 the component would like to be aligned relative to other 
 components.  The value should be a number between 0 and 1
 where 0 represents alignment along the origin, 1 is aligned
 the furthest away from the origin, 0.5 is centered, etc.
<p>
</dl>
<a name="getLayoutAlignmentY(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutAlignmentY"><b>getLayoutAlignmentY</b></a>
<pre>
 public float getLayoutAlignmentY(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Returns the alignment along the y axis.  This specifies how
 the component would like to be aligned relative to other 
 components.  The value should be a number between 0 and 1
 where 0 represents alignment along the origin, 1 is aligned
 the furthest away from the origin, 0.5 is centered, etc.
<p>
</dl>
<a name="invalidateLayout(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="invalidateLayout"><b>invalidateLayout</b></a>
<pre>
 public void invalidateLayout(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Invalidates the layout, indicating that if the layout manager
 has cached information it should be discarded.
<p>
</dl>
<a name="layoutContainer(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="layoutContainer"><b>layoutContainer</b></a>
<pre>
 public void layoutContainer(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Lays out the specified container using this grid bag layout.
 This method reshapes components in the specified container in 
 order to satisfy the contraints of this <code>GridBagLayout</code> 
 object.
 <p>
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the container in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>, <a href="java.awt.Container.html#doLayout">doLayout</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string representation of this grid bag layout's values.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this grid bag layout.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="GetLayoutInfo(java.awt.Container, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="GetLayoutInfo"><b>GetLayoutInfo</b></a>
<pre>
 protected GridBagLayoutInfo GetLayoutInfo(<a href="java.awt.Container.html#_top_">Container</a> parent,
                                           int sizeflag)
</pre>
<dl>
  <dd> Print the layout constraints.  Useful for debugging.
<p>
</dl>
<a name="AdjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="AdjustForGravity"><b>AdjustForGravity</b></a>
<pre>
 protected void AdjustForGravity(<a href="java.awt.GridBagConstraints.html#_top_">GridBagConstraints</a> constraints,
                                 <a href="java.awt.Rectangle.html#_top_">Rectangle</a> r)
</pre>
<a name="GetMinSize(java.awt.Container, java.awt.GridBagLayoutInfo)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="GetMinSize"><b>GetMinSize</b></a>
<pre>
 protected <a href="java.awt.Dimension.html#_top_">Dimension</a> GetMinSize(<a href="java.awt.Container.html#_top_">Container</a> parent,
                                GridBagLayoutInfo info)
</pre>
<a name="ArrangeGrid(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="ArrangeGrid"><b>ArrangeGrid</b></a>
<pre>
 protected void ArrangeGrid(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.GridBagConstraints.html#_top_">Previous</a>  <a href="java.awt.GridLayout.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
