-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateObserver.java
More file actions
42 lines (34 loc) · 1.05 KB
/
UpdateObserver.java
File metadata and controls
42 lines (34 loc) · 1.05 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
import javax.swing.JDialog;
import javax.swing.JLabel;
public class UpdateObserver implements Observer {
private Subject updateControl;
public UpdateObserver(Subject updateObserver)
{
this.updateControl=updateObserver;
updateControl.registerObserver(this);
}
@Override
public void update(Performance Perform) {
// TODO Auto-generated method stub
}
@Override
public void fail() {
// TODO Auto-generated method stub
JDialog a=new JDialog();
a.add(new JLabel("입력이 실패되었습니다.."));
a.setSize(300,300);
a.setVisible(true);
}
@Override
public void update(Performance Perform, Performance previous) {
// TODO Auto-generated method stub
int index = DBHelper.getInstance().getPerforms().indexOf(previous);
DBHelper.getInstance().getPerforms().set(index, Perform);
DBHelper.getInstance().getHost().getPerformanceList().set(index, Perform.getName());
JDialog a=new JDialog();
System.out.println("입력 완료");
a.add(new JLabel("입력이 완료 되었습니다."));
a.setSize(300,300);
a.setVisible(true);
}
}