return panel;
}
protected JDesktopPane getOffersPanel(ArrayList<Offer> offers, int width, ResourceBundle messages)
{
JDesktopPane panel = new JDesktopPane();
checkGroup = new ArrayList<JCheckBox>();
int numOffers = offers.size();
int x = 10;
int y = 20;
int i = 0;
for (i = 0; i < numOffers; i++)
{
JCheckBox offerLab = new JCheckBox(messages.getString("label.offer"));
offerLab.setSize((int) offerLab.getPreferredSize().getWidth(), 30);
offerLab.setLocation(x, y);
offerLab.setBackground(Color.WHITE);
offerLab.setActionCommand(offers.get(i).getId());
checkGroup.add(offerLab);
panel.add(offerLab);
JLabel offerPrice = new JLabel(offers.get(i).getPrice());
offerPrice.setSize((int) offerPrice.getPreferredSize().getWidth(), 30);
offerPrice.setLocation((width - 310) / 3, y);
panel.add(offerPrice);
JLabel offerCond = new JLabel(offers.get(i).getCondition());
offerCond.setSize((int) offerCond.getPreferredSize().getWidth(), 30);
offerCond.setLocation(2 * (width - 310) / 3, y);
panel.add(offerCond);
y = y + 40;
}
addCart = new JButton(messages.getString("button.cart"));
addCart.setSize((int) addCart.getPreferredSize().getWidth(), 50);
addCart.setLocation(width - 200, y);
addCart.addActionListener(this);
panel.add(addCart);
panel.setBorder(BorderFactory.createTitledBorder(messages.getString("offer.title")));
panel.setSize(width - 35, y + 60);
panel.setPreferredSize(panel.getSize());
panel.setMinimumSize(panel.getSize());
panel.setMaximumSize(panel.getSize());
return panel;
}