The moose likes Swing / AWT / SWT and the fly likes combo.getSelectedItem problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "combo.getSelectedItem problem" Watch "combo.getSelectedItem problem" New topic

combo.getSelectedItem problem

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i populate this combo from database and wrote some code that prints the selected object's id
i've this button that deletes the selected item; what happens is that, when i delete several items, suddenly my printlines show repeated ids, say 3 or 4 lines with the very same info and only from one single click.
this is problem one; my second problem is that i cant retrieve my last item, because when there's only one left it doesnt print at all, like it wasnt never selected
my relevant code (i tried action event and item event):

what am i doing wrong?


java amateur
I agree. Here's the link:
subject: combo.getSelectedItem problem
It's not a secret anymore!