I would like to make JComboBoxes scrollable by dragging their contents. It makes sense for a touch-screen app. I think I could manage to do it if there was a way to programmatically scroll a JComboBox. Is there?
I would like to make JComboBoxes scrollable by dragging their contents. It makes sense
Share
I’m not sure I understand the question since the popup of the combo box is scrollable by default.
However, in general, to scroll a component added to a scrollpane you would use the scrollRectToVisible(…) method on that component.
The combo box popup uses a JList to hold each item. You can access the JList using: