Home Help Java G Java Gridlayout



Java Gridlayout
Posted on: November 11, 2009 at 12:00 AM
Some times we need to create GUI that have a matrix-type layout with columns of same widths and rows of same heights.

Java Gridlayout

     


Some times we need to create GUI that have a matrix-type layout with columns of same widths and rows of same heights. For this purpose, the layout manager "GridLayout" class, defined in "java.awt" package, is used that lays out components in different equally sized rectangular cells. 

You can set number of columns and number of rows by it's constructor GridLayout(int rows, int cols) or by methods setRows() and setColumns(). You can also set horizontal and vertical gaps with its constructor GridLayout(int rows, int cols, int hgap, int vgap) or by methods setHgap(int hgap) and setVgap(int vgap).


Read more at:

http:/www.roseindia.net/java/java-tips/GUI/layouts/30gridlayout.shtml

 

Related Tags for Java Gridlayout:


More Tutorials from this section

Ask Questions?    Discuss: Java Gridlayout  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.