KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > swing > BoxLayout

javax.swing
Class BoxLayout

java.lang.Object
  extended by 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
/* 
       < Applet code=CustomerInfo width=500 height=150 >  
       < /Applet >  
  */
 
  
  
   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  

Popular Tags