Package items

Examples of items.Item


   * when user selects an item in the menu
   */
  private void display(int i){
    if(i > currentStore.getInventory().getLength())
      System.out.println("problem's right ere capt'n");
    Item item = currentStore.getInventory().getItem(i);
    lblName.setText(item.getName());
    lblWeight.setText(""+item.getWeight()+" lbs");
    lblPrice.setText("$"+currentStore.getInventory().getPrice(item, currentStore.getPrices()));
    lblDesc.setText(item.getDescription());
    lblResponse.setText(item.getResponse());
  }
View Full Code Here


 
  /**
   * when user attempts to buy an item from inventory
   */
  private void buy(int i) throws InsufficientFundsException, WeightCapacityExceededException{
    Item item = currentStore.getInventory().getItem(i);
    currentStore.buy(item, Integer.parseInt(txtAmount.getText()));
    lblResponse.setText(item.getBoughtResponse());
  }
View Full Code Here

TOP

Related Classes of items.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.