Forums Register Login

adding values to a JComboBox at runtime[urgent]

+Pie Number of slices to send: Send
Hi, I'm unable to add a value to a JComboBox using the additem().I receive an error that this methos has caused an error in this Mutable_model.
Please reply as soon as possible.
Happy Middling with java.
Bye from Netharam.
+Pie Number of slices to send: Send
Hi, netharam,
I had the same problem before. What I did is to put all data in the Vector(you may use array) and call yourCB.setModel(new DefaultComboBoxModel(YourVector));
YourCB.validate();
It works, but I think it's not a good idea because everytime one data changes, my comboBox has to changes its model. Please let me know when you have a better solution, Thanks!
Good luck!
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1058 times.
Similar Threads
refreshing the jframe[urgent]
couldn't install java 1.4 in win200 server[very....... urgent......]
Have a common JScrollBar for more than one JList [urgent]
How to add icons along with the text in a JList[urgent]
resizing a Jlist's width by the user[urgent]
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:15:22.