This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Suppose that we have a container including JButtons and one JTextField, and another one containing JList, JCombobox, JTable ... objects.
Let us also suppose that we want to be able to delete a row in the drop-down list of a JComboBox, in the table ...
I can figure that the best practice is to pass on 'Action events' from one container to the other and to implement listeners. I that correct ?
> Preventing the drop-down list of a JComboBox to close ?
I'd say it's do-able, probably need to set your own UI overriding whatever method
fires (to close the popup) when the dialog takes focus. But, this is unlikely to work
for all L&F's, so it's gunna be messy.
probably easier to use another component (JList, JTable?), and, if necessary,
control it's display size i.e. show just 1 line, expand to 8 lines when in use, then
return to 1 line size after add/edit/whatever