java.lang.Object
javax.swing.BoxLayout
- All Implemented Interfaces:
- LayoutManager, LayoutManager2, Serializable
- Direct Known Subclasses:
- DefaultMenuLayout
- See Also:
- Top Examples, Source Code,
XMLEncoder
, Box
,
ComponentOrientation
,
JComponent.getAlignmentX()
,
JComponent.getAlignmentY()
public void addLayoutComponent(Component comp,
Object constraints)
- See Also:
- LayoutManager2
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void addLayoutComponent(String name,
Component comp)
- See Also:
- LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public BoxLayout(Container target,
int axis)
- See Also:
- AWTError
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[331]Create Applet using 3 different layout
By venki568 { at } yahoo { dot } com on 2004/10/06 00:52:06 Rate
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class CustomerInfo extends JApplet
{
Container container=getContentPane ( ) ;
JPanel jp=new JPanel ( ) ;
JRadioButton rbutton1 =new JRadioButton ( "Account mailing" ) ;
JRadioButton rbutton2 =new JRadioButton ( "Account taxing" ) ;
JRadioButton rbutton3 =new JRadioButton ( "Subscription taxing" ) ;
JButton button=new JButton ( "Address assignment" ) ;
public void init ( )
{
Container container=getContentPane ( ) ;
container.setLayout ( new FlowLayout ( 4,3,3 ) ) ;
FlowLayout f=new FlowLayout ( FlowLayout.LEFT,15,20 ) ;
container.setLayout ( f ) ;
container.setLayout ( new FlowLayout ( 24,23,23 ) ) ;
GridBagLayout grid=new GridBagLayout ( ) ;
container.setLayout ( grid ) ;
GridBagConstraints c=new GridBagConstraints ( ) ;
c.fill=GridBagConstraints.BOTH;
container.setLayout ( new BoxLayout ( container,BoxLayout.Y_AXIS ) ) ;
jp.setBorder ( BorderFactory.createLineBorder ( Color.green ) ) ;
button.setBorder ( BorderFactory.createLineBorder ( Color.red,1 ) ) ;
container.setSize ( 200,200 ) ;
container.setVisible ( true ) ;
container.add ( rbutton1 ) ;
container.add ( rbutton2 ) ;
container.add ( rbutton3 ) ;
container.add ( button ) ;
}
}
public float getLayoutAlignmentX(Container target)
- See Also:
- AWTError, LayoutManager2
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float getLayoutAlignmentY(Container target)
- See Also:
- AWTError, LayoutManager2
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void invalidateLayout(Container target)
- See Also:
- AWTError, LayoutManager2
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void layoutContainer(Container target)
- See Also:
- AWTError, LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int LINE_AXIS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension maximumLayoutSize(Container target)
- See Also:
minimumLayoutSize(java.awt.Container)
, preferredLayoutSize(java.awt.Container)
, AWTError, LayoutManager2
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension minimumLayoutSize(Container target)
- See Also:
maximumLayoutSize(java.awt.Container)
, preferredLayoutSize(java.awt.Container)
, AWTError, LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int PAGE_AXIS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension preferredLayoutSize(Container target)
- See Also:
maximumLayoutSize(java.awt.Container)
, minimumLayoutSize(java.awt.Container)
, AWTError, LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeLayoutComponent(Component comp)
- See Also:
- LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int X_AXIS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int Y_AXIS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples