|
@@ -68,7 +68,14 @@ public class Gallery extends JPanel implements Observer, Serializable
|
|
|
{
|
|
|
if (model.getGrid())
|
|
|
{
|
|
|
- this.setLayout(new FlowLayout(10));
|
|
|
+ int unit = 200;
|
|
|
+ int total = this.getWidth();
|
|
|
+ if (items.size() > 0)
|
|
|
+ {
|
|
|
+ int unit = items.get(i).getWidth();
|
|
|
+ }
|
|
|
+ int cols = total / unit;
|
|
|
+ this.setLayout(new GridLayout(0, cols));
|
|
|
}
|
|
|
else
|
|
|
{
|