Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPossibleState.java
More file actions
Latest commit
48 lines (42 loc) · 1.61 KB
/
Copy pathPossibleState.java
File metadata and controls
48 lines (42 loc) · 1.61 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
43
44
45
46
47
48
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.util.Date;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JPanel;
publicclassPossibleStateextendsJFrameimplementsCancelTicketState{
privatestaticPossibleStatesingleton = newPossibleState();
privatePossibleState(){};
publicstaticCancelTicketStategetInstance(){
returnsingleton;
}
publicCancelTicketStatecheckDay(Datedate){
if(date.before(newDate()))
returnImpossibleState.getInstance();
else
returnsingleton;
}
publicvoidmakeCancelBtn(JPanelorderpanel, JButton[] cancelBtn, intindex, intsize){
cancelBtn[index] = newJButton("예매취소");
cancelBtn[index].setBounds(240,50*index,90,50);
cancelBtn[index].setFont(newjava.awt.Font("Gulim", 0, 15));
orderpanel.add(cancelBtn[index]);
cancelBtn[index].addActionListener(newActionListener() // 공연등록 버튼 페이지 경로
{
publicvoidactionPerformed(ActionEvente) {
intindex=0;
for(inti=0; i<size;i++)
{
if(cancelBtn[i]==e.getSource())
{
index=i;
break;
}
}
DBHelper.getInstance().cancelTicket(DBHelper.getInstance().getAudience().getTickets().get(index));
OrderViewnewOrderView=newOrderView(); // Main Form to show after the Login Form.
dispose();
}
});
}
}