I currently have a JFrame that has a JList.

I declare the JList in the following fashion:
constructListModel _idListModel = new constructListModel();
JList _idList = new JList(_idListModel);

The constructListModel actually is just the following:
public class constructListModel extends DefaultListModel{

public constructListModel(){
super();
}
public void rowChanged(int start, int end){
fireContentsChanged(this,start,end);
}
}

Now when I create the JFrame, we basically want to display the window
first while creating a separate thread to retrieve information from
the Database and inserting the result set into a constructListModel.
When this thread returns as finished, the JLIst should "refresh" now
displaying the retrieved records.

see that the count of the list model is correct in "rowChanged"
however, the display does not show all the records retrieved. The
JList display is still blank. I have tried "repaint", "revalidate",
etc. and it still does not work.

Any suggestions?

Thanks.
Lisa

Post a follow-up to this message

Message 2 in thread
From: Christian Kaufhold (usenet@chka.de)
Subject: Re: Updating the DefaultListModel and "repainting" the JList...

Newsgroups: comp.lang.java.gui
Date: 2001-07-11 14:39:46 PST



Lisa <lcheng1@telcordia.com> wrote:

> The constructListModel actually is just the following:
> public class constructListModel extends DefaultListModel{
> public constructListModel(){
> super();
> }
> public void rowChanged(int start, int end){
> fireContentsChanged(this,start,end);
> }
> }
> Now when I create the JFrame, we basically want to display the window
> first while creating a separate thread to retrieve information from
> the Database and inserting the result set into a constructListModel.
> When this thread returns as finished, the JLIst should "refresh" now
> displaying the retrieved records.
> see that the count of the list model is correct in "rowChanged"
> however, the display does not show all the records retrieved. The
> JList display is still blank. I have tried "repaint", "revalidate",
> etc. and it still does not work.



Please post more code.


Christian

Post a follow-up to this message

Message 3 in thread
From: Laurent Garnier (lgarnier@genigraph.fr)
Subject: Re: Updating the DefaultListModel and "repainting" the JList...

Newsgroups: comp.lang.java.gui
Date: 2001-07-12 00:39:06 PST



Classic update in another thread than AWT ?
If so, try SwingUtilities.invokeLater.

Lisa a écrit :
>
> I currently have a JFrame that has a JList.
>
> I declare the JList in the following fashion:
> constructListModel _idListModel = new constructListModel();
> JList _idList = new JList(_idListModel);
>
> The constructListModel actually is just the following:
> public class constructListModel extends DefaultListModel{
>
> public constructListModel(){
> super();
> }
> public void rowChanged(int start, int end){
> fireContentsChanged(this,start,end);
> }
> }
>
> Now when I create the JFrame, we basically want to display the window
> first while creating a separate thread to retrieve information from
> the Database and inserting the result set into a constructListModel.
> When this thread returns as finished, the JLIst should "refresh" now
> displaying the retrieved records.
>
> see that the count of the list model is correct in "rowChanged"
> however, the display does not show all the records retrieved. The
> JList display is still blank. I have tried "repaint", "revalidate",
> etc. and it still does not work.
>
> Any suggestions?
>
> Thanks.
> Lisa


Post a follow-up to this message

Message 4 in thread
From: Lisa (lcheng1@telcordia.com)
Subject: Re: Updating the DefaultListModel and "repainting" the JList...

Newsgroups: comp.lang.java.gui
Date: 2001-07-12 08:06:50 PST



The code is situated in the following fashion:

public class MyDialog extends JFrame {