iFrmPrProvice = new JComboBox();
iFrmPrProvice.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Iterator ProvinceIt = dao.queryProvince().iterator();
while (ProvinceIt.hasNext()) {
PROVINCE p = (PROVINCE) ProvinceIt.next();
iFrmPrProvice.addItem(p.getPROVINCENAME());
}
}
});
iFrmPrProvice.addItem("选择省");
iFrmPrProvice.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (iFrmPrCity != null) {
iFrmPrCity.removeAllItems();
}
if (iFrmPrCountry != null) {
iFrmPrCountry.removeAllItems();
}
provinceName = iFrmPrProvice.getSelectedItem().toString();
PROVINCE pr = (PROVINCE) dao.queryProvinceByName(provinceName);
Set c = pr.getCity();
for (Iterator it = c.iterator(); it.hasNext();) {
CITY city = (CITY) it.next();
iFrmPrCity.addItem(city.getCITYNAME());
}
}
});
getContentPane().add(iFrmPrProvice, "8, 2, fill, fill");
iFrmPrCity = new JComboBox();
iFrmPrCity.addItem("选择市");
iFrmPrCity.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (iFrmPrCountry != null) {
iFrmPrCountry.removeAllItems();
}
cityName = iFrmPrCity.getSelectedItem().toString();
CITY c = (CITY) dao.queryCityByName(cityName);
Set country = c.getCountry();
for (Iterator it = country.iterator(); it.hasNext();) {
COUNTRY co = (COUNTRY) it.next();
iFrmPrCountry.addItem(co.getCOUNTRYNAME());
}
}
return;
}
});
getContentPane().add(iFrmPrCity, "10, 2, fill, fill");
iFrmPrCountry = new JComboBox();
iFrmPrCountry.addItem("选择县");
getContentPane().add(iFrmPrCountry, "12, 2, fill, fill");
{
JScrollPane scrollPane = new JScrollPane();
getContentPane().add(scrollPane, "2, 4, 11, 1, fill, fill");
iFrmPrdescription = new JTextArea();
scrollPane.setViewportView(iFrmPrdescription);
iFrmPrdescription.setFont(new Font("仿宋_GB2312", Font.PLAIN, 20));
iFrmPrdescription.setLineWrap(true);
}
}