private void addProducts() { List<Product> prods = Product.findByCategory(category, mainWindow.getDbManager()); for (final Product product : prods) { ProductItem productItem = new ProductItem(product); productItem.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { mainWindow.showPanel(new ProductDetails(mainWindow, product)); } }); products.add(productItem); } products.add(Box.createVerticalGlue()); }
public void main(IWContext iwc) throws Exception { super.main(iwc); drawObject(); }