Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java G Java Gridlayout

Related Tutorials


 
 

Share on Google+Share on Google+

Java Gridlayout

Advertisement
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

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 11, 2009

Related Tutorials

Discuss: Java Gridlayout  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com