我有一個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); } }這工作得很好,但是無論何時調(diào)用此方法,我都希望CheckComboBox打開下拉菜單。我在CheckComboBox頂部覆蓋了一個文本框,因此用戶無法單擊它。最終,我希望它看起來像一個自動完成下拉菜單,只要用戶在文本框中鍵入,它就會下拉。換句話說,如何在不讓用戶單擊的情況下激活CheckComboBox的下拉事件?
添加回答
舉報
0/150
提交
取消