I am trying to format the output of my program, so it looks easily readable by the user. I am not that good at formatting text and I would really welcome your help.
I am trying to print/display(in my JTextArea). I already have a method to display there:
public void display(String... lines){
for(String line:lines){
System.out.println(line);
}
}
Now, I have the 2 ArrayLists that contain some data which was added to them through the use of the program.
itemOrders = new ArrayList<CafeOrders>();
customers = new ArrayList<CafeCustomer>();
The constructors, respectively:
public CafeOrders(String orderID, String itemName, double price){
super();
this.orderID = orderID;
this.itemName = itemName;
this.price = price;
}
and
public CafeCustomer(int customerID, String customerName){
super();
this.customerID = customerID;
this.customerName = customerName;
this.orderNo = UUID.randomUUID().toString();
}
I made it in such a way, that orderNo = orderID.
First the customer name is asked, then when he selects from a list of items, each item is added to the CafeOrders ArrayList along with the customer's ID.
I want to create a method that prints those 2 ArrayLists in the specific format, or something similar:
customerName "with id" orderID "has purchased" itemName1
itemName2
itemName3
etc...
Any help would be appreciated!