Garmaine Staff asked 2 years ago
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 7 hours ago.

This post is hidden. It was deleted 5 mins ago by Bhargav Rao♦. I have two arrayLists called Restaurant and Dish.

Now i have a panel of swing with one combo box called (restaurants) and one input field called (plateName) and one button.

I have add a arrayList of restaurants in combo box so there are restaurants.

The main problem is when i choose a restaurant then the name of the dish which is created in a restaurant class is not being showed.

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here:

String r = (String) restaurant.getSelectedItem();

Restaurant rt = showRestaurants(r);
if (rt != null) {
    for (Dish dish : dishs) {
        plateName.setText(dish.getDishName());

    }
}

}