1 importjava.awt.FlowLayout;2 importjava.awt.event.ItemEvent;3 importjava.awt.event.ItemListener;4 importjava.util.HashMap;5 importjavax.swing.JComboBox;6 importjavax.swing.JFrame;7 importjavax.swing.JLabel;8 importjavax.swing.WindowConstants;9
10 public class JComboBoxExample extends JFrame implementsItemListener {11
12
13 JLabel ProvinceJL;//Province label
14 JComboBox ProvinceJCB;//Province drop-down list
15 JLabel CityJL;//The city label
16 JComboBox CityJCB;//City drop-down list
17 JLabel DistrictAndCountyJL;//Area county label
18 JComboBox DistrictAndCountyJCB;//District and county drop-down list19
20
21 //Set the corresponding hash
22 HashMapcont1;23 HashMapcont2;24 //Component defined25
26 //A constructor
27 publicJComboBoxExample(){28 init();29
30 }31
32 private void init(){//Initialize the33
34 //All