Ok, here's what I need to do:
Create an abstract class named “Customer”.
Add 2 private fields to the class, “name” and “id”.
Add a constructor that takes 2 arguments, “aName” and “aId”.
Add the following abstract method “public abstract double discount();”
Create a Child class of Customer named “OnlineCustomer”.
Add a constructor that takes 2 arguments, name, id.
Write the body of the inherited abstract discount method.
Online customers get a 10% discount.
Create a JFrame class for your user interface named “CustomerJFrame”.
I can create the button, but have trouble with the text fields and JLabels. I need the first JLabel and text field lined up on the first row, then a second jlabel and text field on the row below it.
I then add a button below that does this:
When the button is selected, create the OnlineCustomer object using the name and id from your JTextFields. Display the name, id and discount in the OnlineCustomer object in the message JLabel.
In the end, it should look like these pictures:
I think I've got the right code for part 1, but I need help on part 2 and 3. What I got won't run.