Skip to content

Commit 43e3bc0

Browse files
authored
on either side of river was there the tree of life
In the midst of the street of it, and on either side of the river, was there the tree of life, which bare twelve manner of fruits, and yielded her fruit every month: and the leaves of the tree were for the healing of the nations. (Revelation 22:2)
1 parent 2b8cb69 commit 43e3bc0

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

  • Multithreading/task28/task3209/HTMLEditor2
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
//In the midst of the street of it, and on either side of the river, was there the tree of life, which bare twelve manner of fruits,
3+
//and yielded her fruit every month: and the leaves of the tree were for the healing of the nations. (Revelation 22:2)
4+
5+
package com.javarush.task.task32.task3209;
6+
7+
import javax.swing.*;
8+
import java.awt.event.ActionEvent;
9+
import java.awt.event.ActionListener;
10+
11+
public class View extends JFrame implements ActionListener {
12+
13+
private Controller controller;
14+
15+
public void init() {}
16+
17+
public void exit() {
18+
controller.exit();
19+
}
20+
21+
public void actionPerformed(ActionEvent actionEvent) {}
22+
23+
public Controller getController() {
24+
return controller;
25+
}
26+
27+
public void setController(Controller controller) {
28+
this.controller = controller;
29+
}
30+
}
31+
32+
/*
33+
HTML Editor (2)
34+
2.1. Добавь в контроллер и представление по методу init(), пока без реализаций. Они будут отвечать за инициализацию контроллера и представления.
35+
2.2. Теперь напишем в классе Controller метод main(). Он должен:
36+
2.2.1. Создавать объект представления.
37+
2.2.2. Создавать контроллер, используя представление.
38+
2.2.3. Устанавливать у представления контроллер.
39+
2.2.4. Инициализировать представление.
40+
2.2.5. Инициализировать контроллер. Контроллер должен инициализироваться после представления.
41+
2.3. Добавь в контроллер метод exit(), он должен вызывать статический метод exit у класса
42+
System.
43+
2.3.1. Метод exit в классе Controller не должен быть статическим.
44+
2.4. Добавь в представление метод exit(), он должен вызывать exit() у контроллера.
45+
46+
47+
Требования:
48+
1. Класс Controller должен содержать метод public void init().
49+
2. Класс View должен содержать метод public void init().
50+
3. Класс Controller должен реализовывать метод public void exit().
51+
4. Класс View должен реализовывать метод public void exit().
52+
5. Реализуй, согласно условию, метод public static void main(String[] args) у класса Controller.
53+
*/

0 commit comments

Comments
 (0)