|
12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- package kommunikation.controller;
-
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import kommunikation.transmitter.BilderKom;
- import kommunikation.view.ViewChat;
-
- /**
- *
- * @author Alexander_Christoph
- */
- public class SendController implements ActionListener
- {
- ViewChat view;
- BilderKom model;
-
- public SendController(ViewChat view, BilderKom model)
- {
- this.view = view;
- this.model = model;
- }
-
- public void registerEvents()
- {
- view.getTfMessage().addActionListener(this);
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0)
- {
- String text = view.getTfMessage().getText();
- view.getTaChat().append("Ich: "+ text+"\n");
- model.senden(text);
- view.getTfMessage().setText("");
- }
-
- }
|