File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Combo boxes update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Combo boxes update" Watch "Combo boxes update" New topic

Combo boxes update

Axel Leucht

Joined: Jan 19, 2009
Posts: 21
I do searching for rooms (I'm doing the UrlyBird assignment) with two combo boxes for location and name respectively.

I might happen that the combo boxes don't display the current state in the database. This might happen e.g. when another client created a room in a new location. The new location isn't among the model for the location combo box. That's why I made the combo box editable. I load the combo boxes initially at application startup and as id is only possible for the client to search and book/release a room I didn't thought about it very much.

But I do wonder if an editable combo box is sufficient and I like to ask on how you do cope with this situation?


pramod karnani
Ranch Hand

Joined: May 22, 2007
Posts: 88
Hello Axel,

In my instruction.html is written "
You may assume that at any moment, at most one program is accessing the database file".

So if application is already running , means database file is already in use so even some changes in the database file occur there is no need to update combo boxes but once you restart the application then combo box will be updated.
I do not know is it written in your instruction or not.

Still you fill that there should be update of combo boxes then you can provide Refresh button in your GUI that will do database trip and update the combo boxes .

Thats what I can suggest.

Roel De Nijs

Joined: Jul 19, 2004
Posts: 8391

Hi Pramod,

What Alex means, is something else (i gues): if you have 2 different networked clients and the second one adds a new room/contractor, how will the combo boxes get refreshed, adding the newly added room/contractor.

Alex, correct me if you meant something else.

Allowing user to choose an item from combo or enter some text, is imho a good alternative. Maybe a refresh button after each combo to refresh its content, is also a good approach...

SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
I agree. Here's the link:
subject: Combo boxes update
It's not a secret anymore!