Example of a Java vending machine applet with a GUI created using the Swing toolkit.
On launch, the user is greated via dialog popup :
The main GUI of the app presents the user with multiple options, consisting of items to select from (Buttons representing the items in the machine), a text field for their monetary input, and three control buttons at the bottom of the window (Checkout button, Reset button and Close button) :
As the user selects items by clicking on the items they want, the items and their respective prices :
After the user enters their money and selected their items, they can click on the checkout button to check wether they entered the correct amount of money. The checkout button will be disabled and a "Pay" button will be displayed. When the pay button is clicked, the user will thanked for their purchase :
If the checkout button is pressed before the user has entered any money, an warning message will be displayed :
Or, if the money entered wasn't enough to cover the total amount of the items selected, a error message will be displayed :
The next phase would be to add stock level management. This will track the amount of stock available for each individual item for sale. This can pull from the CSV and read / write the new amounts to the data file.