Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.chat;
- import java.awt.event.ActionListener;
- /**
- * Controls a {@link View}.
- *
- * @author Ludwig
- *
- */
- public class Controller {
- private View view;
- /**
- * Creates a new controller.
- */
- public Controller() {
- view = new View();
- ActionListener al = event -> {
- view.sendMessage(view.getMessage() + '\n');
- };
- view.addActionListener(al);
- }
- /**
- * The entry point of the application.
- *
- * @param args
- * The command-line arguments.
- */
- public static void main(String[] args) {
- new Controller();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement