IvjEventHandler ivjEventHandler = new IvjEventHandler();
getJList1().addListSelectionListener(ivjEventHandler);
public void jList1_ListSelectionEvents() {
Object selectValue = getJList1().getSelectedValue()
return;
}

解决方案 »

  1.   

    class IvjEventHandler implements javax.swing.event.ListSelectionListener {
     public void valueChanged(javax.swing.event.ListSelectionEvent e) {
      if (e.getSource() == this.getJList1()) 
        jList1_ListSelectionEvents();
     };
    }
      

  2.   

    谢谢楼上的
    不过,小弟还是不能理解,能不能在详细点
    那个IvjEventHandler是什么
      

  3.   

    不是都用java.awt.event吗
    Jlist只能用swing下面的event?
      

  4.   

    mListTableName.addListSelectionListener(
              new ListSelectionEvent()
              {
                public void valueChanged(javax.swing.event.ListSelectionEvent e) 
                {
                    System.out.println(mListTableName.getSelectedValue().toString());
                }          });小弟这段代码编译时候出现错误,帮我看看,谢谢
      

  5.   

    是new ListSelectionListener
    不是new ListSelectionEvent()