Yeah! Carsten. You are right, I am too stubborn, to a point that attempt in
implementing ListDataListener, thinking contentschanged method may helps...I
used yours suggestion now....Very much thanks......
But by the way, I haven't use revalidate and repaint, it works already, is
it OK? not to do repaint/revalidate.
^_- Thanks
Chan
"Carsten Højgaard" <nospam_carsten@hojgard.dk> ¼¶¼g©ó¶l¥ó·s»D
:3d9601b3$0$18147$edfadb0f@dspool01.news.tele.dk...
> > I use JComboBox to display retrieved data (in form of Vector) in
database,
> >
> > databaseVector = database.getVector();
> > JComboBox jcbInstance = new JComboBox(dataBaseVector);
> >
> > but after database content changed, I do:
> >
> > databaseVector = newVectorValue;
> > jcbInstance.revalidate();
> > jcbInstance.repaint();
> >
>
> --------------------------------------------------------------------------
> --
> > ---------------
> > Then I find that the ComboBox just display something old, not refreshing
> > stuff.
> >
> > Could anyone help me with this? Thank you and welcome any suggestion.
>
> Hi Chan,
>
> This works for me. It's probaly not the best solution... but it works
>
> jcbInstance.removeAllItems();
> for (int i = 0; i < databaseVector .size(); i++)
> jcbInstance.addItem(databaseVector .get(i));
>
>
>