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 pathAddPerform2_View.java
More file actions
Latest commit
108 lines (84 loc) · 3.39 KB
/
Copy pathAddPerform2_View.java
File metadata and controls
108 lines (84 loc) · 3.39 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
importjavax.swing.*;
importjava.awt.*;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
publicclassAddPerform2_ViewextendsJFrame//implements ActionListener
{
ContainercontentPane;
String[] timestamp = {"15:00", "16:00", "17:00", "18:00","19:00","20:00","21:00","22:00"} ;
HomeView_hostnewhost;
HomeView_audiencenewaudience;
AddPerformControllercontroller =
newAddPerformController();
AddPerform2_View(StringperformName,intplaceNum, intmonthNum,intdayNum, intduration, Stringprice, StringText)
{
contentPane=this.getContentPane();
JPaneladd1panel = newJPanel();
setBounds(80,80,250,500);
this.setVisible(true);
this.setLayout( null);
JLabeltitle = newJLabel("공연 등록 - [2/2]");
JLabelsubtitle = newJLabel("<날짜별 시간 선택>");
JButtonbtn1 = newJButton("완료");
JButtonbtn2 = newJButton("취소");
// 선택한 기간에 따라 label 갯수 생성
JLabellabel[] = newJLabel[duration+1]; //SAMPLE 1
JComboBoxdrop[] = newJComboBox[duration+1];
for(inti=0; i<duration+1; i++)
{
label[i] = newJLabel("날짜"+i +": ");
drop[i] = newJComboBox(timestamp);
label[i].setBounds(30, 110+ (i*40), 70, 40); //SAMPLE 1
drop[i].setBounds(110, 110+(i*40), 100, 30);
label[i].setFont(newjava.awt.Font("Gulim", 0, 14));
drop[i].setFont(newjava.awt.Font("Gulim", 0, 14));
add1panel.add(label[i]); //SAMPLE 1
add1panel.add(drop[i]);
}
title.setBounds(30, 20, 200, 40);
subtitle.setBounds(30, 70, 170, 40);
btn1.setBounds(160,420,70,50);
btn2.setBounds(80,420,70,50);
title.setFont(newFont("Gulim", Font.BOLD, 15));
subtitle.setFont(newjava.awt.Font("Gulim", 0, 14));
add1panel.add(title);
add1panel.add(subtitle);
add1panel.add(btn1);
add1panel.add(btn2);
btn1.addActionListener(newActionListener()
{
publicvoidactionPerformed(ActionEvente) {
String[] Time = newString[duration+1];
for(inti=0; i<duration+1;i++)
{
Time[i] = timestamp[drop[i].getSelectedIndex()];
}
controller.eventAddPerformance(performName,placeNum,monthNum, dayNum+1, Time, duration, price, Text);
DBHelperhelper = DBHelper.getInstance();
/* if(helper.getHost() !=null)
{
newhost =new HomeView_host();
}
else if(helper.getAudience()!=null)
{
newaudience = new HomeView_audience();
}*/
dispose();
}
});
btn2.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente)
{
dispose();
newhost= newHomeView_host();
}
});
// frame setting
add1panel.setVisible(true);
add1panel.setLayout(null);
setSize(350,600);
this.setContentPane(add1panel);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}