Java应用程序设计SwingGUIn(3)addItem(Object item);和insertItemAt(Object item,int index);JComboBox icb=new JComboBox();icb.addItem(“士兵证”);icb.addItem(“驾驶证”);icb.insertItemAt(“身份证”,0);NORTHWESTCENTEREASTSOUTHn焦点事件由FocusEvent类捕获,对于焦点事件可以通过实现FocusListener接口处理相应的事件;nFocusListener接口原型:public interface FocusListener extends EventListenerpublic void focusGained(FocusEvent e);public void focusLost(FocusEvent e);nFocusEvent类比较常用的方法getSource():获取触发事件的目标对象;例子:FocusEventDemo.javanMouseEvent类捕获鼠标事件,可通过MouseListener接口处理鼠标事件;nMouseListener有5个抽象方法(下页)BUTTON33标右键标右键