View RSS Feed

Recent Blogs Posts

  1. Layout Managers and Containers

    by , 03-04-2012 at 05:26 PM
    A container must contain a layout manager to perform its work. If a layout manager is not associated with a container, the container will place the components wherever specified using following methods.
    A layout manager must be present in a container so that work could be performed. If container and layout manager are not associated with each other, the components will be placed by the container wherever specified by using these methods.

    1. setBounds()
    2. setSize()
    3. setLocation()
  2. List of Layout Managers

    by , 03-04-2012 at 11:49 AM
    Pre-defined entire layout manager is present in java.awt. Interface java.awt.LayoutManager is implemented by the layout manager.

    Every AWT i.e Abstract Windows Toolkit & swing container consists of a pre-defined default layout manager.
    • container.setLayout can be used for setting or changing the layout manager.
    • Interface java.awt.LayoutManager is implemented for customized layout manager.

    Layout managers that are pre-defined are given here:
    • java.awt.BorderLayout
    • java.awt.FlowLayout
    • java.awt.CardLayout
    • java.awt.GridLayout
    • java.awt.GridBagLayout
  3. Layout Managers

    by , 01-08-2012 at 01:35 PM
    FlowLayout: Applet and Panel has FlowLayout as their default layout. It lays components from left to right.

    BorderLayout: Frame and Dialog has BorderLayout as their default layout. It lays components in north, south, east, west and center.

    CardLayout: stack of same size components arranged inside each other.

    GridLayout: Makes a bunch of components equal in size and displays them in the requested number of rows and columns.

    GridBagLayout: ...