public void addInventory(Inventory inv) {
   add(inv);
   inv.setBounds(x, y, 47, 42);
   if (last != count) {
     x += 50;
     last += 1;
   } else {
     x = 2;
     y += 50;
     last = 0;
   }
   setPreferredSize(new Dimension(82 * count, y + 30));
 }