jmitch18
02-06-2008, 04:37 PM
I have a project at the minute which is basically a medical conditions and symptoms database. Basically the idea is that the user can select a symptom from one List which will then update another list with all the related condition. Then the user can select a condition from that list and view information on it.
The problem occurs when I try to update the conditions list after a symptom has been selected. The action event works fine but I just can't make it update the conditions list. Here is the method that's supposed to do that
private void getConditions(String selected)
{
db.result = db.selectQuery(query);
String[] conditionList = db.stringArray(db.result, "conditionName");
conditions = new List(10);
for(int i = 0; i < conditionList.length; i++)
{
conditions.add(conditionList[i]);
}
}
I tried using conditions.removeAll() to empty the list but it always produced a run-time error so I decided to try making a new List but no luck. The list is inside a JPanel.
Anyone got any ideas on how to solve this?
The problem occurs when I try to update the conditions list after a symptom has been selected. The action event works fine but I just can't make it update the conditions list. Here is the method that's supposed to do that
private void getConditions(String selected)
{
db.result = db.selectQuery(query);
String[] conditionList = db.stringArray(db.result, "conditionName");
conditions = new List(10);
for(int i = 0; i < conditionList.length; i++)
{
conditions.add(conditionList[i]);
}
}
I tried using conditions.removeAll() to empty the list but it always produced a run-time error so I decided to try making a new List but no luck. The list is inside a JPanel.
Anyone got any ideas on how to solve this?