-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdatePerform1_View.java
More file actions
150 lines (127 loc) · 5.4 KB
/
UpdatePerform1_View.java
File metadata and controls
150 lines (127 loc) · 5.4 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by Eunbee on 2016-05-15.
*/
public class UpdatePerform1_View extends JFrame {
Container contentPane;
String[] monthstamp = {"January","February","March","April","May","June","July","August","September","October","November","Desember"};
String[] placestamp = {"학관 101호", "학관 104호", "채플"};
String[] daystamp = new String[31];
String[] periodstamp = new String[7];
int i = 0;
UpdatePerform2_View newupdatePerform2;
HomeView_host newHost;
UpdatePerform1_View(Performance perform)
{
contentPane=this.getContentPane();
JPanel add1panel = new JPanel();
setBounds(0,0,350,600);
this.setVisible(true);
this.setLayout( null);
JLabel title = new JLabel("공연 수정 - [1/2]");
JLabel label1 = new JLabel("공연 이름 :");
JLabel label2 = new JLabel("장소 :");
JLabel label3 = new JLabel("날짜 :");
JLabel label4 = new JLabel("기간 :");
JLabel label5 = new JLabel("공연 설명 :");
JLabel label6 = new JLabel("금액 :");
JTextArea area1 = new JTextArea(); //공연설명
JTextField field1 = new JTextField(15); //공연이름
JTextField field2 = new JTextField(15);
field1.setText(perform.getName());
field2.setText(String.valueOf(perform.getCost()));
area1.setText(perform.getDescription());
String[] splitString =perform.getSchedule().getFirstDay().toString().split("-");
int month = Integer.parseInt(splitString[1]);
int date = Integer.parseInt(splitString[2]);
JButton btn1 = new JButton("다음");
JButton btn2 = new JButton("취소");
for(i=0;i<31;i++) // Dropdown
{
daystamp[i] = String.valueOf(i+1);
}
for(i=0;i<7;i++)
{
periodstamp[i] = String.valueOf(i+1);
}
JComboBox monthList = new JComboBox(monthstamp);
JComboBox dayList = new JComboBox(daystamp);
JComboBox periodList = new JComboBox(periodstamp);
JComboBox placeList = new JComboBox(placestamp);
monthList.setSelectedIndex(month-1);
dayList.setSelectedIndex(date-1);
title.setBounds(30, 20, 200, 40);
label1.setBounds(30,70,80,40); //공연이름
label2.setBounds(30,110,80,40); //장소
label3.setBounds(30,150,80,40); //날짜
label4.setBounds(30,190,80,40); //기간
label5.setBounds(30,270,80,40); //공연 설명
btn1.setBounds(160,460,70,50);
btn2.setBounds(80,460,70,50);
area1.setBounds(30,310,200,130);
label6.setBounds(30,230,80, 40);
field1.setBounds(110,70, 120, 30);
monthList.setBounds(110, 150, 60, 30);
dayList.setBounds(180,150, 50,30);
periodList.setBounds(110, 190, 70, 30);
placeList.setBounds(110,110,120,30);
field2.setBounds(110,230,120,30);
title.setFont(new Font("Gulim", Font.BOLD, 15));
label1.setFont(new java.awt.Font("Gulim", 0, 14));
label2.setFont(new java.awt.Font("Gulim", 0, 14));
label3.setFont(new java.awt.Font("Gulim", 0, 14));
label4.setFont(new java.awt.Font("Gulim", 0, 14));
label5.setFont(new java.awt.Font("Gulim", 0, 14));
label6.setFont(new java.awt.Font("Gulim", 0, 14));
btn1.setFont(new java.awt.Font("Gulim", 0, 14));
btn2.setFont(new java.awt.Font("Gulim", 0, 14));
area1.setFont(new java.awt.Font("Gulim", 0, 14));
field1.setFont(new java.awt.Font("Gulim", 0, 14));
monthList.setFont(new java.awt.Font("Gulim", 0, 14));
dayList.setFont(new java.awt.Font("Gulim", 0, 14));
periodList.setFont(new java.awt.Font("Gulim", 0, 14));
placeList.setFont(new java.awt.Font("Gulim", 0, 14));
add1panel.add(title);
add1panel.add(label1);
add1panel.add(label2);
add1panel.add(label3);
add1panel.add(label4);
add1panel.add(label5);
add1panel.add(field1);
add1panel.add(btn1);
add1panel.add(btn2);
add1panel.add(area1);
add1panel.add(monthList);
add1panel.add(dayList);
add1panel.add(periodList);
add1panel.add(placeList);
add1panel.add(field2);
add1panel.add(label6);
btn1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e) {
newupdatePerform2 = new UpdatePerform2_View(perform,field1.getText(),placeList.getSelectedIndex(),
monthList.getSelectedIndex(),dayList.getSelectedIndex(),
periodList.getSelectedIndex(),area1.getText()); // Main Form to show after the Login Form.
dispose();
}
});
btn2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
dispose();
newHost =new HomeView_host();
}
});
// frame setting
add1panel.setVisible(true);
add1panel.setLayout(null);
setSize(350,600);
this.setContentPane(add1panel);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}