posted 13 years ago
Good day
I need a JComboBox or JList or JTable object where I can:
- select an item by the usual simple left click (default behaviour of JCombobox)
- get a dialog box by double clicking (or shift click or any else). This dialog box enables to:
- suppress an existing item
- add a space before an existing item, and then edit it (JTestField in a JDialogBox or JOptionPane)
- shift an item up or down in the list (Mutable items)
Anything I think I'm certainly not the only one to desire, is it ?
Could you give us some useful hints ? E.g.
- No JCombobox, rather JList because ...
- Need to use a data model, a CellRenderer, a CellEditor, an EventHandler ...
- regarding the event handler
- possible stumbling blocks
- URL of site to find code example in this direction
I think it would not succeed with a JComboBox because when attempting to double-click an item, as soon as the first click occured, the selection event handler operates and the box closes, leaving no time for a second click.
JList doesn't offer cell edition capabilities on the contrary of a JTable cell. That would not be an issue as the edition may occur in a JTestField of a JDialogBox or JOptionPane.
Thanks for any good intention ...
And thanks to Big Moose Saloon and their subscribers for the efficient tips that I got before ...