Something wrong with JBList
While working with JBList, I place it into the central area of a JPanel that uses a BorderLayout.
When the list has few entries, a click on the empty area beneath the last element is interpreted as a click on that last item.
Can someone explain what might be causing this behavior and guide me on the correct usage of JBList?
The code just like:
DefaultListModel<String> dataModel = new DefaultListModel<>();
dataModel.addElement("one");
dataModel.addElement("two");
dataModel.addElement("three");
JBList<String> testJBList = new JBList<>(dataModel);
JBLoadingPanel mainPanel = new JBLoadingPanel(new BorderLayout(), this, 0);
mainPanel.setVisible(true);
mainPanel.add(testJBList,BorderLayout.CENTER);
And click to empty area,“three” will be selected:
Please sign in to leave a comment.
Hi,
I pasted your code in the tool window code sample (https://github.com/JetBrains/intellij-sdk-code-samples/tree/main/tool_window) to reproduce the issue and it works as expected.