Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridLayout help!

 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a list of Images that line up in a grid independent of the number of images, lets say I have 15 images it should look like this:

_____
|*****|
|*****|
|*****|

but lets say the images are now only 8 then I still want it to line up like this:

_____
|*****|
|*** |
| |

I made the layout as follows: setLayout(new GridLayout(10, 5));
But the problem is when there are few images all of them are in the center:
_____
| |
|*****|
|*** |

How can I make the images line up starting at topleft and continue right, then break into the next line when there are 10 images in the current line?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ August 06, 2005: Message edited by: Craig Wood ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic