Sunday, March 9, 2008

GridBag Layout

My actual requirement is the figure shown. I am not really good at swings and was learning it with this application. I was trying various layouts, but none of them helped me to actually get good results for my application, then finally came across grid layout. It has some of the wonderful features like it divides the frame into grids in which it is similar to the grid layout but can also add features like setting the location of the component, filling the component horizontally in the grid or vertically, we can set up the grid width and height. We can change the properties of the grid using the GridBagConstraints class. And later using this object when we are actually adding components to the frame or panel. I am new to swings, this is just a way to share my experiences, any suggestions and changes would be greatly appreciated.

No comments: