-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProb01.java
More file actions
61 lines (44 loc) · 1.43 KB
/
Copy pathProb01.java
File metadata and controls
61 lines (44 loc) · 1.43 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
package java0915_gui.prob;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
class MenuItem extends JFrame implements ActionListener {
JComboBox<String> firstCom, secondCom;
JTextArea ta;
String[] foodMain = new String[] { "선택하세요", "한식", "중식", "일식" };
String[][] foodSub = new String[][] { { "선택하세요", "불고기", "비빔밥", "삼계탕" }, { "선택하세요", "짬뽕", "짜장", "탕수육" },
{ "선택하세요", "돈부리", "우동", "덮밥" } };
boolean chk = false;
public MenuItem() {
firstCom = new JComboBox<String>(foodMain);
secondCom = new JComboBox<String>();
secondCom.addItem("선택하세요");
JPanel jp = new JPanel();
jp.add(new JLabel("MENU : "));
jp.add(firstCom);
jp.add(secondCom);
ta = new JTextArea(10, 15);
add(BorderLayout.NORTH, jp);
add(BorderLayout.CENTER, ta);
setSize(400, 300);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}// end MenuItem
@Override
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
if (obj == firstCom) {
}
}
}// end class
public class Prob01 {
public static void main(String[] args) {
MenuItem mt = new MenuItem();
}// end main()
}// end class