public static void addToTable(Item item,int quantity) throws NullPointerException {

		if (item.getQuantity() >= quantity) {
		total = (getTotal() + item.getPrice() * quantity);
		item.changeQuantity(-quantity);
		modifyItem(item);
		int datalength = (tableData == null ? 0 : tableData.length);
		Object[][] temp = new Object[datalength + 1][5];
		if (tableData != null)
			for (int i = 0; i < datalength; i++)
				for (int j = 0; j < 5; j++)
					temp[i][j] = tableData[i][j];
		temp[datalength][0] = item.getId();
		temp[datalength][1] = item.getName();
		temp[datalength][2] = quantity;
		temp[datalength][3] = item.getPrice();
		temp[datalength][4] = item.getDescription();
		tableData = temp;
		}
	}