-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathView.java
More file actions
30 lines (25 loc) · 672 Bytes
/
Copy pathView.java
File metadata and controls
30 lines (25 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package Chat;
import java.awt.Dimension;
import java.util.Observable;
import javax.swing.JEditorPane;
/**
* View of the conversation
*
* @author joar
*/
public class View extends JEditorPane {
Conversation conversation;
/**
* Creates html view of a given conversation
*
* @param conversation the conversation
*/
public View(Conversation conversation) {
this.conversation = conversation;
this.conversation.addObserver((Observable o, Object arg) -> {
View.this.setText(((Conversation) o).getHTML());
});
View.this.setContentType("text/html");
View.this.setEditable(false);
}
}