I will call com. intellij. ui After adding TextFieldWithAutoCompletion<String>to JBPopupMenu, it was found that the original input prompt was missing and could only be entered without being deleted
I will call com. intellij. ui After adding TextFieldWithAutoCompletion<String>to JBPopupMenu, it was found that the original input prompt was missing and could only be entered without being deleted
Map<String, Icon> dataMap = Map.of(
"ly-yxwz-ui", ImageUtils.JSX_DARK,
"ly-yxxt-ui", ImageUtils.JSX_DARK,
"ly-gyxt-ui", ImageUtils.JSX_DARK,
"ly-xtgl-ui", ImageUtils.JSX_DARK,
"ly-xtgl-svc", ImageUtils.SPRINGBOOT_DARK,
"ly-yxxt-svc", ImageUtils.SPRINGBOOT_DARK,
"ly-yxwz-svc", ImageUtils.SPRINGBOOT_DARK,
"ly-gyxt-svc", ImageUtils.SPRINGBOOT_DARK
);
completion = FastTextFieldWithAutoCompletion.create(project);
completion.setPreferredSize(290, 30);
completion.setItems(dataMap.keySet().stream().toList());
completion.setItem2IconMap(dataMap);
jPopupMenu.setPopupSize(300, 55);
jPopupMenu.setLayout(new BorderLayout());
jPopupMenu.add(completion, BorderLayout.CENTER);
(FastTextFieldWithAutoCompletion is a class I directly wrote, which inherits TextFieldWithAutoCompletion and simplifies some operations)
Please sign in to leave a comment.
Is there any alternative solution
I want to achieve this effect