Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI: Put the database data in Combo Box 1

Status
Not open for further replies.

aas1611

Programmer
Dec 14, 2001
184
DE

I have a database table (DEPARTMENT) that contains a list of department in a company, such as Sales, Accounting, Distribution, etc.

I want to put these data in a combo box so the user can choose from this list. On top of that, I want to add "All Departments" to the list.

So the combo box list appeared on user end is:
All Departments -> (not in the database table)
Sales
Accounting
Distribution
etc

How I can do this with JComboBox? Can someone help me, or at least refer me to some information about it?

Thanks very much!

Andre
 
It doesnt seems to be a problem :
first, make a JCombo.additem("All Departments") and than in a for loop that reads all depts from db make an additem for each one.

Water is not bad as long as it remains outside human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top