java.lang.Object
java.awt.GridLayout
- All Implemented Interfaces:
- LayoutManager, Serializable
- See Also:
- Top Examples, Source Code
public void addLayoutComponent(String name,
Component comp)
- See Also:
- LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getColumns()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getHgap()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRows()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getVgap()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public GridLayout()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public GridLayout(int rows,
int cols)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public GridLayout(int rows,
int cols,
int hgap,
int vgap)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[729]Data entry form
By pankaj_tendulkar { at } hotmail { dot } com on 2004/04/11 08:34:18 Rate
import java.awt.*;
import java.awt.event.*;
class review extends Frame
{
Panel titlePnl;
Panel msgPnl;
Panel infPnl;
Panel mainPnl;
Panel btnPnl;
Label heading;
Panel lblPnl;
TextArea msg;
Label l [ ] = new Label [ 20 ] ;
TextField t [ ] = new TextField [ 20 ] ;
Button home,Purchase,Recalculate;
int i;
String nameOr [ ] = { "","Necklace","Ring ","Earring " } ;
String nameBooks [ ] = { "","God of Small things","Wings of fire ","Pride and Prejudice" } ;
String nameComp [ ] = { "","PentiumII","PentiumIII","PentiumIV" } ;
String priceOr [ ] = { "","10","10","10" } ;
String priceBooks [ ] = { "","10","10","10" } ;
String priceComp [ ] = { "","10","10","10" } ;
review ( main2 m2 )
{
setSize ( 700,700 ) ;
Label lblPrice = new Label ( "Name Price Quantity Total" ) ;
//setBackground ( Color.black ) ;
mainPnl = new Panel ( ) ;
titlePnl = new Panel ( ) ;
infPnl = new Panel ( ) ;
msgPnl = new Panel ( ) ;
btnPnl = new Panel ( ) ;
lblPnl = new Panel ( ) ;
msg = new TextArea ( "This is you order",6,95 ) ;
msg.setEditable ( false ) ;
mainPnl.setLayout ( new BorderLayout ( ) ) ;
titlePnl.setLayout ( new FlowLayout ( ) ) ;
infPnl.setLayout ( new GridLayout ( 26,1,0,0 ) ) ;
btnPnl.setLayout ( new FlowLayout ( ) ) ;
msgPnl.setLayout ( new FlowLayout ( ) ) ;
lblPnl.setLayout ( new FlowLayout ( ) ) ;
heading = new Label ( "ReviewCart" ) ;
titlePnl.add ( heading ) ;
mainPnl.add ( titlePnl,BorderLayout.NORTH ) ;
msgPnl.add ( msg ) ;
mainPnl.add ( msgPnl,BorderLayout.CENTER ) ;
//int s = m2.bookAr [ 1 ] ;
infPnl.add ( lblPrice ) ;
infPnl.add ( new Label ( "" ) ) ;
for ( i=0;i < =3;i++ )
{
if ( m2.ornAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameOr [ i ] +" " +priceOr [ i ] +" " +m2.ornAr [ i ] ) ) ;
infPnl.add ( t [ i ] = new TextField ( 8 ) ) ;
}
if ( m2.bookAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameBooks [ i ] +" " +priceBooks [ i ] +" " +m2.bookAr [ i ] ) ) ;
infPnl.add ( t [ i ] = new TextField ( 8 ) ) ;
}
if ( m2.compAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameComp [ i ] +" " +priceComp [ i ] +" " +m2.compAr [ i ] ) ) ;
infPnl.add ( t [ i ] = new TextField ( 8 ) ) ;
}
}
mainPnl.add ( infPnl,BorderLayout.SOUTH ) ;
home = new Button ( "HOME" ) ;
btnPnl.add ( home ) ;
Purchase = new Button ( "PURCHASE" ) ;
btnPnl.add ( Purchase ) ;
Recalculate = new Button ( "RECALCULATE" ) ;
btnPnl.add ( Recalculate ) ;
mainPnl.add ( btnPnl,BorderLayout.EAST ) ;
add ( mainPnl ) ;
addWindowListener ( new WindowAdapter ( )
{
public void windowClosing ( WindowEvent we )
{
System.exit ( 0 ) ;
}
} ) ;
setVisible ( true ) ;
}
review ( main3 m3 )
{
setSize ( 700,700 ) ;
Label lblPrice = new Label ( "Price Quantity Total" ) ;
//setBackground ( Color.black ) ;
mainPnl = new Panel ( ) ;
titlePnl = new Panel ( ) ;
infPnl = new Panel ( ) ;
msgPnl = new Panel ( ) ;
msg = new TextArea ( "This is you order",6,95 ) ;
msg.setEditable ( false ) ;
mainPnl.setLayout ( new BorderLayout ( ) ) ;
titlePnl.setLayout ( new FlowLayout ( ) ) ;
infPnl.setLayout ( new GridLayout ( 26,1,10,0 ) ) ;
msgPnl.setLayout ( new FlowLayout ( ) ) ;
heading = new Label ( "ReviewCart" ) ;
titlePnl.add ( heading ) ;
mainPnl.add ( titlePnl,BorderLayout.NORTH ) ;
msgPnl.add ( msg ) ;
mainPnl.add ( msgPnl,BorderLayout.CENTER ) ;
infPnl.add ( lblPrice ) ;
for ( i=0;i < =3;i++ )
{
if ( m3.ornAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameOr [ i ] +" " +priceOr [ i ] +" " +m3.ornAr [ i ] ) ) ;
}
if ( m3.bookAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameBooks [ i ] +" " +priceBooks [ i ] +" " +m3.bookAr [ i ] ) ) ;
}
if ( m3.compAr [ i ] != 0 )
{
infPnl.add ( l [ i ] = new Label ( "" +nameComp [ i ] +" " +priceComp [ i ] +" " +m3.compAr [ i ] ) ) ;
}
}
mainPnl.add ( infPnl,BorderLayout.SOUTH ) ;
add ( mainPnl ) ;
addWindowListener ( new WindowAdapter ( )
{
public void windowClosing ( WindowEvent we )
{
System.exit ( 0 ) ;
}
} ) ;
setVisible ( true ) ;
}
}
public void layoutContainer(Container parent)
- See Also:
Container.doLayout()
, LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension minimumLayoutSize(Container parent)
- See Also:
Container.doLayout()
, preferredLayoutSize(java.awt.Container)
, LayoutManager
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension preferredLayoutSize(Container parent)
- See Also:
Container.getPreferredSize()
, minimumLayoutSize(java.awt.Container)
, 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 void setColumns(int cols)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setHgap(int hgap)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRows(int rows)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setVgap(int vgap)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String toString()
- See Also:
- Object
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples