-1

could somebody insert the necessary code in this so that it works, as i need to get it working very soon.

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JFrame;
import java.awt.*;
import javax.swing.*;
import javax.swing.JOptionPane;
import java.awt.event.*;

public class AddCust extends Name implements ActionListener{
  
  Name name;
  Address address;
  Loan loan;
  Borrower borrower;
  JTextField tfName,tfSName, tfAddress;
  
  
  public AddCust() {
    
	 
	     			// Create a name
    			 name = new Name("John", 'D', "Smith");

    			// Create an address
    			 address = new Address("100 Main Street", "Savannah",
      		"GA", "31419");

    			// Create a loan
   			  loan = new Loan(5.5, 15, 250000);

    			// Create a borrower
    			 borrower = new Borrower(name, address);

   			 borrower.setLoan(loan);

   			 // Display loan information
    			JOptionPane.showMessageDialog(null, borrower.toString());
    setLayout(new FlowLayout(FlowLayout.LEFT, 10, 30));

    // Add labels and text fields to the frame
    add(new JLabel("First Name"));
    add(tfName = new JTextField(8));
    add(new JLabel("Last Name"));
    add(tfSName = new JTextField(8));
    add(new JLabel("Address"));
    add(tfAddress = new JTextField(50));
	 add(new JLabel("Occupation"));
	 add(new JTextField(10));
	 add(new JLabel("Salary"));
	 add(new JTextField(7));
	 add(new JLabel("Phone Number"));
	 add(new JTextField(10));
	 add(new JLabel("PPS Number"));
	 add(new JTextField(10));
	 add(new JButton("Submit"));
	 
  }

  /** Main method */
  public static void main(String[] args) {
    AddCust frame = new AddCust();
    frame.setTitle("Add new Customer");
    frame.setLocationRelativeTo(null); 
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(600,300);
    frame.setVisible(true);
 }	 
	 	 
		 

			public void actionPerformed(ActionEvent event)
			{
				String a = jtfMessage.getText();
				String b = jtfMessage.getText();
				String c = jtfMessage.getText();
				String d = jtfMessage.getText();
				String e = jtfMessage.getText();
				String f = jtfMessage.getText();
				String g = jtfMessage.getText();
			
		
	 
  }
}
Votes + Comments
have fun
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

Nope.

You haven't even stated what it is supposed to do and what you are having trouble understanding. Just glancing at it, you've got a ways to go before this is complete.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.