Hello, I have to create a program in java, which is based on an ordering system. I have the following classes : orders, orders list, supplier, supplier list, payment, payment list. The program is developed in javafx, and the user can create new orders, create suppliers, make payments for the orders based on the id of the order. But I can not figure out how to assign a supplier to an order.

I will make screenshots of my code, I tried writing if else conditions and methods, but they do not work, so some help would be appreciated.

I have thought about storing suppliers in the list, and then try and modify the method that creates the order to ask for a supplier input based on the stored values, but I can not figure out how to do that.

I can not add images

this is the code for the creating orders with my attempt

static void addHandler(int noOfOrderNrIn, OrderList listIn,int noOfSupplierNrIn, SupplierList slistIn)
{


System.out.println("Enter order number: ");
int orderNrEntered = EasyScanner.nextInt();

System.out.println("Enter name: ");
String nameOrdEntered = EasyScanner.nextString();

System.out.println("Enter description: ");
String descEntered = EasyScanner.nextString();

System.out.println("Enter quantity: ");
String quantityEntered = EasyScanner.nextString();

System.out.println("Enter supplier number: ");
int suppNrEntered = EasyScanner.nextInt();


//Order o = new Order(orderNrEntered, nameOrdEntered, descEntered, quantityEntered);
//listIn.addOrder(o);
//System.out.println("New order " + orderNrEntered + " successfully added");
System.out.println("Checking if the supplier exists: ");







if(orderNrEntered < 1 || orderNrEntered > noOfOrderNrIn)
{
System.out.println ("There are only " + noOfOrderNrIn + " orders");
}
else if(listIn.search(orderNrEntered) != null)
{
System.out.println("Order " + orderNrEntered + " exists");
System.out.println("Checking if the supplier exists: ");
}
else if(suppNrEntered< 1 || suppNrEntered > noOfSupplierNrIn)
{
System.out.println ("There are only " + noOfSupplierNrIn + " suppliers");
}
else if(slistIn.searchNr(suppNrEntered) != null)
{
System.out.println("Supplier " + suppNrEntered + " exists");
Order o = new Order(orderNrEntered, nameOrdEntered, descEntered, quantityEntered);
listIn.addOrder(o);
System.out.println("New order " + orderNrEntered + " successfully added");
}


}



this is the code to add suppliers, the code for adding orders was similar to this one before my attempt

static void addHandler2(int noOfSupplierNrIn, SupplierList listIn)
{

System.out.println("Enter supplier number: ");
int supplierNrEntered = EasyScanner.nextInt();

System.out.println("Enter name: ");
String nameSuppEntered = EasyScanner.nextString();

System.out.println("Enter Address: ");
String addressEntered = EasyScanner.nextString();

System.out.println("Enter phone number: ");
String numberEntered = EasyScanner.nextString();


if(supplierNrEntered < 1 || supplierNrEntered > noOfSupplierNrIn)
{
System.out.println ("There are only " + noOfSupplierNrIn + " suppliers");
}
else if(listIn.searchNr(supplierNrEntered) != null)
{
System.out.println("Supplier " + supplierNrEntered + " exists");
}
else // ok to add an supplier
{
Supplier s = new Supplier(supplierNrEntered, nameSuppEntered,addressEntered, numberEntered);
listIn.addSupplier(s);
System.out.println("New Supplier" + supplierNrEntered + " successfully added");
}
}