Re: Retrieving information from MySQL Database
- From: Ian Wilson <scobloke2@xxxxxxxxxxxxx>
- Date: Tue, 26 Sep 2006 11:49:57 +0100
christopher_board@xxxxxxxxxxx wrote:
Hi. I am trying to retrieve information from a MySQL database and
placing it in a JTable. However the code I have used gets the results
and displays it in the system output. However no results are placed in
the JTable. Does anyone know the reason.
Yes, I do. You are not passing any data to your JTable constructor.
<code snipped>
You are also constructing the JTable inside a loop, this seems a bad idea.
Since your "cells" variable isn't suitable for passing to JTable() directly, I'd use a TableModel to feed your "cells" data to a JTable. I haven't looked closely at your code so I'm assuming your "cells" variable eventually holds the entire set of data for the table.
.
- References:
- Retrieving information from MySQL Database
- From: christopher_board
- Retrieving information from MySQL Database
- Prev by Date: Re: Retrieving information from MySQL Database
- Next by Date: Re: Simple 3D Point Plotting
- Previous by thread: Re: Retrieving information from MySQL Database
- Next by thread: Re: Retrieving information from MySQL Database
- Index(es):
Relevant Pages
|