我有一個(gè)CheckComboBox,其中填充了使用以下方法從網(wǎng)站獲取的數(shù)據(jù)。public void getCompanies() { // This method is called every time the user types a letter in the URLText box. // Grab data from the website and add the data to a list. HTMLParser p = new HTMLParser(URLText.getText()); List<String> a = p.GetCompanyNames(); // Remove old data so new data can be added. dropdownMultiple.getItems().remove(0, dropdownMultiple.getItems().size()); for(String element : a) { dropdownMultiple.getItems().add(element); } }這工作得很好,但是無(wú)論何時(shí)調(diào)用此方法,我都希望CheckComboBox打開(kāi)下拉菜單。我在CheckComboBox頂部覆蓋了一個(gè)文本框,因此用戶無(wú)法單擊它。最終,我希望它看起來(lái)像一個(gè)自動(dòng)完成下拉菜單,只要用戶在文本框中鍵入,它就會(huì)下拉。換句話說(shuō),如何在不讓用戶單擊的情況下激活CheckComboBox的下拉事件?
添加回答
舉報(bào)
0/150
提交
取消