-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_LocationRunner.java
82 lines (37 loc) · 1.45 KB
/
4_LocationRunner.java
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
package MyPackage1;
import javax.swing.*;
import java.awt.Color;
import java.awt.event.*;
public class LocationRunner implements ActionListener {
public String location;
public static JComboBox drop_down1;
public static JButton b;
public JFrame f = new JFrame("Location");
public LocationRunner()
{
f.setSize(600, 500);
//final String input1 = new String();
JLabel cities = new JLabel("Select Your City: ");
cities.setBounds(40, 100, 200, 30);
f.add(cities);
String city[] = {"Mumbai", "Chennai", "Bangalore", "Delhi", "Hyderabad"};
drop_down1 = new JComboBox(city);
drop_down1.setBounds(180, 100, 200, 30);
f.add(drop_down1);
b = new JButton("Ok");
b.setBounds(400, 100, 100, 30);
f.add(b);
b.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Location2 l2 = new Location2((String)drop_down1.getItemAt(drop_down1.getSelectedIndex()));
}
});
f.setLayout(null);
f.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
}