public ViewCustomer(ModelShop model){
		super("Käuferansicht");
		this.model = model;
		model.addObserver(this);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(600,450);
		JPanel mainPanel = (JPanel) getContentPane();
		mainPanel.setLayout(new GridBagLayout());
		
		// Einkäufe
		orderScrollList = new JList<>();
		orderScrollList.setCellRenderer(new OrderRenderer());
		JScrollPane scrollPane = new JScrollPane(orderScrollList);
		scrollPane.setBorder(BorderFactory.createTitledBorder("Einkäufe"));
		
		//Verfügbare Produkte 
		JPanel productview = new JPanel();
		productview.setLayout(new BoxLayout(productview,BoxLayout.Y_AXIS));
		productview.setBorder(BorderFactory.createTitledBorder("Produkte"));
		buyButton = new JButton("kaufen");
		tmodel = new DefaultTableModel() {
			private static final long serialVersionUID = 22383555879965890L;
			public boolean isCellEditable(int row,int column){
				return column == 4;
			}
			public void	setValueAt(Object aValue,int row,int column){
				if(column == 4){
					String a = ((String) aValue).trim();
					if(a.equals("")){
						aValue = 0;
					} 
					else {
						int c = 0;
						try{
							 c = Integer.parseInt(a);
						} catch (NumberFormatException e) {
							JOptionPane.showMessageDialog(null,
			                          "Falsche Eingabe :" + a + " !",
			                          "Ungültige Bestellanzahl",
			                          JOptionPane.ERROR_MESSAGE);
							aValue = 0;
							c = 0;
						}
						String b = (String) getValueAt(row, column - 1 );
						int d = Integer.parseInt(b.trim());
						if(c < 0 || c > d){
							JOptionPane.showMessageDialog(null,
			                          "Bitte korrigieren Sie die Bestellanzahl!",
			                          "Ungültige Bestellanzahl",
			                          JOptionPane.ERROR_MESSAGE);
							aValue = 0;
						}
					}
				} 
				super.setValueAt(aValue, row, column);
			}
		};
		tmodel.addColumn("ProduktId");
		tmodel.addColumn("Name");
		tmodel.addColumn("Preis");
		tmodel.addColumn("verfügbar");
		tmodel.addColumn("bestellen");
		table = new JTable(tmodel);
		table.setFillsViewportHeight(true);
		JScrollPane productScrollPane = new JScrollPane(table);
		productview.add(productScrollPane);
		buyButton.setAlignmentX(LEFT_ALIGNMENT);
		productview.add(buyButton);
		
		chatPanel = new JPanel();
		chatPanel.setBorder(BorderFactory.createTitledBorder("Chat"));
		chatPanel.setLayout(new BorderLayout());
		textArea = new JTextArea(10,10);
		textArea.setLineWrap(true);
		textArea.setLineWrap(true);
		textArea.setEditable(false);
		JScrollPane fScroller = new JScrollPane(textArea);
		fScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
		fScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		textArea.setBorder(BorderFactory.createEtchedBorder());
		chatPanel.add(fScroller,BorderLayout.CENTER);
		textField = new JTextField(50);
		sendButton = new JButton("Senden");
		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel,BoxLayout.X_AXIS));
		panel.add(textField);
		panel.add(sendButton);
		chatPanel.add(panel,BorderLayout.PAGE_END);
		
		GridBagConstraints a = new GridBagConstraints();
		a.fill = GridBagConstraints.BOTH;
		a.gridx = 0;
		a.gridy = 0;
		a.weightx = 0.5;
		a.weighty = 0.4;
		GridBagConstraints b = new GridBagConstraints();
		b.fill = GridBagConstraints.BOTH;
		b.anchor = GridBagConstraints.PAGE_END;
		b.gridx = 1;
		b.gridy = 0;
		b.weightx = 0.5;
		GridBagConstraints c = new GridBagConstraints();
		c.fill = GridBagConstraints.BOTH;
		c.gridwidth = 2;
		c.gridx = 0;
		c.gridy = 1;
		c.weighty = 0.7;
		c.weightx = 0.6;
		
		mainPanel.add(scrollPane,a);
		mainPanel.add(productview,b);
		mainPanel.add(chatPanel,c);
//		pack();
		setVisible(true);
	}