2014-12-01 45 views
0

我在窗體上實現了數據更改偵聽器,並且它工作得很好,但是當我嘗試在對話框的窗體上實現它時,它似乎不起作用。可能是什麼問題?這裏是我的代碼...以對話框形式實現數據更改偵聽器

protected void onMain_AddMemberAction(final Component c, ActionEvent event) { 

    //Show the dialog box that has the form. 
    final Dialog d = (Dialog)createContainer(fetchResourceFile(), "GUI 1"); 
    d.show(); 
    //Listen to the data change on the text field. 
    findPostalCode(c).addDataChangeListener(new textListener() { 
     public void dataChanged(int type, int index) { 
     //Run the following method 
     test(c); 
     } 
    }); 

} 

private abstract class textListener implements DataChangedListener { 

} 

預先感謝您

回答

0

展現的是一個阻塞方法,從而被設置在對話框後,你的聽衆只能註冊。使用showModless