My question is related to combo boxes.
A combo box in general is a text field with a dropdown list. I would want to know if we can replace hthe dropdown List by an other component, for example a JTable component.
A custom renderer would still render in a JList. Not replace the dropdown with a table.
I've done this by adding a PopupMenuListener to the JComboBox and implementing this one method: (Java 8 code)In that code, LocalDateCombo is the outer class, that extends JComboBox, and popupMenu is a JPopupMenu to which a JPanel has been added. To use a JTable you would probably want to wrap it in a JScrollPane or add the table header and the table to a BoxLayout.VERTICAL or other suitable layout and add that to the JPopupMenu.
There are no new questions, but there may be new answers.
Nothing up my sleeve ... and ... presto! A tiny ad: