Subject Re: [Firebird-Java] Maintaining single connection
Author Gabriel Reid
On Tue, Nov 16, 2004 at 12:03:56PM +1030, Shannon Lloyd wrote:
> something seems to be preventing me from
> drawing swing components while the connection is alive. I am retrieving
> a ResultSet from a stored procedure on the server, then iterating over
> it to generate a Vector of objects. This works fine, and I can output
> debug msgs to the console to show that this is all happening as
> expected. However, I then try to create a JList and populate it with one
> of the fields, but the JList does not appear on the screen. If I close
> the connection, however, the JList immediately appears on the screen
> (with the correct data displayed). Any idea why I would need to close
> the connection before I can display a JComponent? >

Are you updating/adding the JList in the event thread? If not, that is
almost certainly the problem (Swing components are not thread safe).

If you _are_ updating the JList in the event thread, could you post a small
test case that demonstrates this behaviour?

Gabriel