JTextBox w/ context menu?
can a jtextbox have a context drop down?
i have many text boxes on a form, and for some of these id like to have a "suggestion list" .
for example they want to place a order, and instead of typing the amount in a case they can simply right click and select "1 case" or "2 cases" , and it simply calculates the amount. this amount is retrieved from a db file which stores all this information.
any ideas?
thanks
[444 byte] By [
llpindda] at [2007-10-3 10:04:03]

yea....
but i already have a bunch of textboxes and dont want to change it... its a late request.and second... i dont want it to select what they choose...but to fire a action which in turn calculates the amount and sets it.a editable combobox will simply set the field they choose from the list?
but id really like a solution where i dont have to change 100 textboxes to comboboxes, but instead add the functionality.
> hi!
> then you prepare a JList and add it into a
> JScrollpane, after that show that in a JPopupMenu. I
> hope that will be a better solution..
>
> :)
after searching a bit, i found this by santhosh http://www.javalobby.org/java/forums/t19867.html
but I don抰 want all my textfields to have this behavior. So a mouse listener (added only to the ones i want) showing a popup on right-click, built using how u described, would be the best solution for this?
although i will still need to add the listener to a bunch of textfields.
thanks