GUI.
In this section we are going to build a simple user interface (GUI) to allow a user to enter their credit card number, etc. In this tutorial we use Java Swing that is built into the NetBeans IDE.
1: From the Projects tab right click on your project and choose New > jFrame Form. Edit the class name if you like, I called it scc. Click the Finish Button.
2: Add a label (jLable1) and place it in the top right corner of the jframe. Double click jLabel1 and rename the text to 'Card Number'.
3: Add another label (jLable2) and place it underneath the first label. Double click jLabel2 and rename the text to 'Result'.
4: Add a Text Field (jTextField1) and place it next to the first label Remove the text by modifying the text fields Text property. Now resize the text field so that it's large enough to hold a card number.
5: Finally add a button (jButton1), modify the text property to 'Validate;
6: Resize the jFrame size if necessary.
You should now have a form looking something like the following:
Now proceed to the next step - Adding the Code >>>
![]() |
©Copyright 2023 Paygate Solutions Limited |