Scenario:
1. Place a JComboBox on a JFrame.
2. Right Click on the JComboBox.
3. Select "Bind" and Click on "elements".
4. Click "Import Data to Form..."
5. Select the database connection to use. [I have the correct
connection set up]
6. Select the table to use.
7. Run the project.
The JComboBox is filled with two items:
Census.Places[placesid=1]
Census.Places[placesid=2]
> My package is "Census"
> NetBeans created is class "Places" that seems to contain code to
handle this dynamic loading.
> My database contains two fields: placeid and place
> Primary Key is placeid, datafield is place.
> There are two records in the database.
So, it looks like I'm close but not close enough!!!
Appreciate any suggestions on what I'm doing wrong and what I need to
get this working.
Thanks...
Bruce
Can anyone suggest what I'm doing wrong. The above note is the
scenario I'm using.
Thanks....
Bruce
From
http://download.oracle.com/javase/tutorial/uiswing/components/combobox.html
"The default renderer knows how to render strings and icons. If you put
other objects in a combo box, the default renderer calls the toString
method to provide a string to display. You can customize the way a combo
box renders itself and its items by implementing your own ListCellRenderer.
"
Notice that if you don't do anything special, and if your objects are not
String or Icon, then toString() will be used to display your objects.
It looks to me like you need to change Places#toString(), or specify a
different renderer for your JComboBox.
Perhaps someone can help if you would explain what IDE you are using.
>> On Oct 15, 9:30 pm, bruce<bruc...@bellsouth.net> wrote:
>>> > NetBeans created is class "Places" that seems to contai
I'm guessing "NetBeans."
Yes, the IDE is NetBeans, 6.9.1.
Thanks for the response.
Bruce