📄 e756. creating a jcombobox component.txt
字号:
// Create a read-only combobox
String[] items = {"item1", "item2"};
JComboBox readOnlyCB = new JComboBox(items);
By default, a combobox only allows the user to select from a predefined list of values. The combobox can be made editable which not only allows the user to select from the predefined list but also to type in any string.
// Create an editable combobox
items = new String[]{"item1", "item2"};
JComboBox editableCB = new JComboBox(items);
editableCB.setEditable(true);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -