-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSurvey.java
More file actions
75 lines (52 loc) · 1.2 KB
/
Survey.java
File metadata and controls
75 lines (52 loc) · 1.2 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
package com.bj;
import javax.swing.*;
import java.awt.*;
public class Survey extends JFrame {
//组件
//JPanel
JPanel jp1,jp2;
//下拉组件JComboBox
JComboBox jcb=null;
//列表框组件JList
JList jl =null;
//滚动窗格组件JScrollPane
JScrollPane jsp=null;
//Label
JLabel jlb1,jlb2;
public static void main(String[] args) {
// TODO Auto-generated method stub
Survey s=new Survey();
}
public Survey(){
//组件
//JPanel
jp1=new JPanel();
jp2=new JPanel();
//Labale
jlb1=new JLabel("籍贯");
jlb2=new JLabel("旅游区");
//城市
String [] jg={"北京","上海","广州","深圳"};
//下拉组件JComboBox
jcb=new JComboBox(jg);
//城市
String [] dd={"故宫","天安门","颐和园","天坛"};
//列表框组件JList
jl =new JList(dd);;
//滚动窗格组件JScrollPane
jsp=new JScrollPane(jl);
jl.setVisibleRowCount(3);
jp1.add(jlb1);
jp1.add(jcb);
jp2.add(jlb2);
jp2.add(jsp);
this.setTitle("Survey");
this.setLayout(new GridLayout(3, 1));
this.setSize(300, 300);
this.setLocation(200,200);
this.add(jp1,BorderLayout.NORTH);
this.add(jp2,BorderLayout.SOUTH);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}