473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Address Book

Help anyone... I'm creating a simple address book java program that would store 100 records. The GUI should be able to accept the name, address, phone no., and email add of a person by clicking a button named ADD. It should also be able to EDIT or DELETE a record and can VIEW ALL ENTRIES.

I have already INSTANTIATED the CLASS, and declared or created the necessary methods(accessor, mutator & constructors) and the arrays(container). I also already created the FORM and the necessary textfield and buttons in it, in a separate CLASS under the same package. The codes for the FORM was automatically generated by the IDE.

My problem is that, how am I going to make the GUI FORM work. Meaning to ADD, EDIT, DELETE or VIEW the entries.

These are the codes so far:
Expand|Select|Wrap|Line Numbers
  1. package addressbook1;
  2.  
  3. public class AddressBook1 {
  4.  
  5.     private String name;
  6.     private String address;
  7.     private String telNum;
  8.     private String emailAdd;
  9.  
  10.     public AddressBook1(String name, String address, String telNum, String emailAdd){
  11.         this.name = name;
  12.         this.address = address;
  13.         this.telNum = telNum;
  14.         this.emailAdd = emailAdd;
  15.     }
  16.  
  17.     public String getName(){
  18.         return name;
  19.     }
  20.     public String getAddress(){
  21.         return address;
  22.     }
  23.     public String getTelNum(){
  24.         return telNum;
  25.     }
  26.     public String getEmailAdd(){
  27.         return emailAdd;
  28.     }
  29.  
  30.     public void setName(String tempName){
  31.         name = tempName;
  32.     }
  33.     public void setAddress(String tempAddress){
  34.         address = tempAddress;
  35.     }
  36.     public void setTelNum(String tempTelNum){
  37.         telNum = tempTelNum;
  38.     }
  39.     public void setEmailAdd(String tempEmailAdd){
  40.         emailAdd = tempEmailAdd;
  41.     }
  42.  
  43.     public static void main(String []args){
  44.  
  45.     }
  46.  
  47. }

Due to limitation of text per discussion, I am posting the codes of the GUI FORM in another discussion titled "Address Book(con't)".
Mar 13 '07 #1
5 4011
Here's the GUI FORM codes generated by the IDE:

Expand|Select|Wrap|Line Numbers
  1. package addressbook1;
  2.  
  3.  
  4. public class AddressBookEntry extends javax.swing.JFrame {
  5.  
  6.     /** Creates new form AddressBookEntry */
  7.     public AddressBookEntry() {
  8.         initComponents();
  9.     }
  10.  
  11.     /** This method is called from within the constructor to
  12.      * initialize the form.
  13.      * WARNING: Do NOT modify this code. The content of this method is
  14.      * always regenerated by the Form Editor.
  15.      */
  16.     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                          
  17.     private void initComponents() {
  18.         lbName = new javax.swing.JLabel();
  19.         tfName = new javax.swing.JTextField();
  20.         lbAddress = new javax.swing.JLabel();
  21.         tfAddress = new javax.swing.JTextField();
  22.         lbTelNum = new javax.swing.JLabel();
  23.         tfTelNum = new javax.swing.JTextField();
  24.         lbEmailAdd = new javax.swing.JLabel();
  25.         tfEmailAdd = new javax.swing.JTextField();
  26.         butAddEntry = new javax.swing.JButton();
  27.         butUpdate = new javax.swing.JButton();
  28.         butDelete = new javax.swing.JButton();
  29.         butViewAllEntries = new javax.swing.JButton();
  30.         butExit = new javax.swing.JButton();
  31.  
  32.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  33.         setTitle("Address Book");
  34.         setName("entryForm");
  35.         lbName.setText("NAME");
  36.         lbName.setName("lbName");
  37.  
  38.         tfName.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  39.         tfName.setName("tfName");
  40.  
  41.         lbAddress.setText("ADDRESS");
  42.         lbAddress.setName("lbAddress");
  43.  
  44.         tfAddress.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  45.         tfAddress.setName("tfAddress");
  46.  
  47.         lbTelNum.setText("Phone No.");
  48.         lbTelNum.setName("lbTelNum");
  49.  
  50.         tfTelNum.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  51.         tfTelNum.setName("tfTelNum");
  52.  
  53.         lbEmailAdd.setText("e-mail");
  54.         lbEmailAdd.setName("lbEmailAdd");
  55.  
  56.         tfEmailAdd.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  57.         tfEmailAdd.setName("tfEmailAdd");
  58.  
  59.         butAddEntry.setText("ADD ENTRY");
  60.         butAddEntry.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  61.         butAddEntry.setName("butAddEntry");
  62.  
  63.         butUpdate.setText("UPDATE");
  64.         butUpdate.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  65.         butUpdate.setName("butUpdate");
  66.  
  67.         butDelete.setText("DELETE");
  68.         butDelete.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  69.         butDelete.setName("butDelete");
  70.  
  71.         butViewAllEntries.setText("VIEW ALL");
  72.         butViewAllEntries.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  73.         butViewAllEntries.setName("butViewAllEntries");
  74.  
  75.         butExit.setText("EXIT");
  76.         butExit.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  77.         butExit.setName("butExit");
  78.  
  79.         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
  80.         getContentPane().setLayout(layout);
  81.         layout.setHorizontalGroup(
  82.             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  83.             .add(layout.createSequentialGroup()
  84.                 .addContainerGap()
  85.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  86.                     .add(butAddEntry, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
  87.                     .add(layout.createSequentialGroup()
  88.                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  89.                             .add(lbName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 55, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  90.                             .add(lbAddress)
  91.                             .add(lbTelNum)
  92.                             .add(lbEmailAdd))
  93.                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  94.                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  95.                             .add(tfAddress, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  96.                             .add(tfName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  97.                             .add(tfTelNum, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  98.                             .add(tfEmailAdd, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)))
  99.                     .add(layout.createSequentialGroup()
  100.                         .add(butUpdate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 98, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  101.                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  102.                         .add(butDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 82, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  103.                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  104.                         .add(butViewAllEntries, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 91, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  105.                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  106.                         .add(butExit, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)))
  107.                 .addContainerGap())
  108.         );
  109.         layout.setVerticalGroup(
  110.             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  111.             .add(layout.createSequentialGroup()
  112.                 .addContainerGap()
  113.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  114.                     .add(lbName)
  115.                     .add(tfName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  116.                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  117.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  118.                     .add(lbAddress)
  119.                     .add(tfAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  120.                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  121.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  122.                     .add(lbTelNum)
  123.                     .add(tfTelNum, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  124.                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  125.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  126.                     .add(lbEmailAdd)
  127.                     .add(tfEmailAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  128.                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  129.                 .add(butAddEntry)
  130.                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  131.                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  132.                     .add(butViewAllEntries)
  133.                     .add(butExit)
  134.                     .add(butDelete)
  135.                     .add(butUpdate))
  136.                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  137.         );
  138.         pack();
  139.     }// </editor-fold>                        
  140.  
  141.     /**
  142.      * @param args the command line arguments
  143.      */
  144.     public static void main(String args[]) {
  145.         java.awt.EventQueue.invokeLater(new Runnable() {
  146.             public void run() {
  147.                 new AddressBookEntry().setVisible(true);
  148.             }
  149.         });
  150.     }
  151.  
  152.     // Variables declaration - do not modify                     
  153.     private javax.swing.JButton butAddEntry;
  154.     private javax.swing.JButton butDelete;
  155.     private javax.swing.JButton butExit;
  156.     private javax.swing.JButton butUpdate;
  157.     private javax.swing.JButton butViewAllEntries;
  158.     private javax.swing.JLabel lbAddress;
  159.     private javax.swing.JLabel lbEmailAdd;
  160.     private javax.swing.JLabel lbName;
  161.     private javax.swing.JLabel lbTelNum;
  162.     private javax.swing.JTextField tfAddress;
  163.     private javax.swing.JTextField tfEmailAdd;
  164.     private javax.swing.JTextField tfName;
  165.     private javax.swing.JTextField tfTelNum;
  166.     // End of variables declaration                   
  167.  
  168. }
Your help is highly appreciated.
Mar 13 '07 #2
r035198x
13,262 8TB
Here's the GUI FORM codes generated by the IDE:

Expand|Select|Wrap|Line Numbers
  1. package addressbook1;
  2.  
  3.  
  4. public class AddressBookEntry extends javax.swing.JFrame {
  5.  
  6. /** Creates new form AddressBookEntry */
  7. public AddressBookEntry() {
  8. initComponents();
  9. }
  10.  
  11. /** This method is called from within the constructor to
  12. * initialize the form.
  13. * WARNING: Do NOT modify this code. The content of this method is
  14. * always regenerated by the Form Editor.
  15. */
  16. // <editor-fold defaultstate="collapsed" desc=" Generated Code "> 
  17. private void initComponents() {
  18. lbName = new javax.swing.JLabel();
  19. tfName = new javax.swing.JTextField();
  20. lbAddress = new javax.swing.JLabel();
  21. tfAddress = new javax.swing.JTextField();
  22. lbTelNum = new javax.swing.JLabel();
  23. tfTelNum = new javax.swing.JTextField();
  24. lbEmailAdd = new javax.swing.JLabel();
  25. tfEmailAdd = new javax.swing.JTextField();
  26. butAddEntry = new javax.swing.JButton();
  27. butUpdate = new javax.swing.JButton();
  28. butDelete = new javax.swing.JButton();
  29. butViewAllEntries = new javax.swing.JButton();
  30. butExit = new javax.swing.JButton();
  31.  
  32. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  33. setTitle("Address Book");
  34. setName("entryForm");
  35. lbName.setText("NAME");
  36. lbName.setName("lbName");
  37.  
  38. tfName.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  39. tfName.setName("tfName");
  40.  
  41. lbAddress.setText("ADDRESS");
  42. lbAddress.setName("lbAddress");
  43.  
  44. tfAddress.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  45. tfAddress.setName("tfAddress");
  46.  
  47. lbTelNum.setText("Phone No.");
  48. lbTelNum.setName("lbTelNum");
  49.  
  50. tfTelNum.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  51. tfTelNum.setName("tfTelNum");
  52.  
  53. lbEmailAdd.setText("e-mail");
  54. lbEmailAdd.setName("lbEmailAdd");
  55.  
  56. tfEmailAdd.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
  57. tfEmailAdd.setName("tfEmailAdd");
  58.  
  59. butAddEntry.setText("ADD ENTRY");
  60. butAddEntry.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  61. butAddEntry.setName("butAddEntry");
  62.  
  63. butUpdate.setText("UPDATE");
  64. butUpdate.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  65. butUpdate.setName("butUpdate");
  66.  
  67. butDelete.setText("DELETE");
  68. butDelete.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  69. butDelete.setName("butDelete");
  70.  
  71. butViewAllEntries.setText("VIEW ALL");
  72. butViewAllEntries.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  73. butViewAllEntries.setName("butViewAllEntries");
  74.  
  75. butExit.setText("EXIT");
  76. butExit.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
  77. butExit.setName("butExit");
  78.  
  79. org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
  80. getContentPane().setLayout(layout);
  81. layout.setHorizontalGroup(
  82. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  83. .add(layout.createSequentialGroup()
  84. .addContainerGap()
  85. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  86. .add(butAddEntry, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
  87. .add(layout.createSequentialGroup()
  88. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  89. .add(lbName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 55, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  90. .add(lbAddress)
  91. .add(lbTelNum)
  92. .add(lbEmailAdd))
  93. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  94. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  95. .add(tfAddress, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  96. .add(tfName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  97. .add(tfTelNum, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
  98. .add(tfEmailAdd, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)))
  99. .add(layout.createSequentialGroup()
  100. .add(butUpdate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 98, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  101. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  102. .add(butDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 82, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  103. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  104. .add(butViewAllEntries, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 91, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  105. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  106. .add(butExit, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)))
  107. .addContainerGap())
  108. );
  109. layout.setVerticalGroup(
  110. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  111. .add(layout.createSequentialGroup()
  112. .addContainerGap()
  113. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  114. .add(lbName)
  115. .add(tfName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  116. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  117. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  118. .add(lbAddress)
  119. .add(tfAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  120. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  121. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  122. .add(lbTelNum)
  123. .add(tfTelNum, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  124. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  125. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  126. .add(lbEmailAdd)
  127. .add(tfEmailAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  128. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  129. .add(butAddEntry)
  130. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  131. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  132. .add(butViewAllEntries)
  133. .add(butExit)
  134. .add(butDelete)
  135. .add(butUpdate))
  136. .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  137. );
  138. pack();
  139. }// </editor-fold> 
  140.  
  141. /**
  142. * @param args the command line arguments
  143. */
  144. public static void main(String args[]) {
  145. java.awt.EventQueue.invokeLater(new Runnable() {
  146. public void run() {
  147. new AddressBookEntry().setVisible(true);
  148. }
  149. });
  150. }
  151.  
  152. // Variables declaration - do not modify 
  153. private javax.swing.JButton butAddEntry;
  154. private javax.swing.JButton butDelete;
  155. private javax.swing.JButton butExit;
  156. private javax.swing.JButton butUpdate;
  157. private javax.swing.JButton butViewAllEntries;
  158. private javax.swing.JLabel lbAddress;
  159. private javax.swing.JLabel lbEmailAdd;
  160. private javax.swing.JLabel lbName;
  161. private javax.swing.JLabel lbTelNum;
  162. private javax.swing.JTextField tfAddress;
  163. private javax.swing.JTextField tfEmailAdd;
  164. private javax.swing.JTextField tfName;
  165. private javax.swing.JTextField tfTelNum;
  166. // End of variables declaration 
  167.  
  168. }
Your help is highly appreciated.
Please keep one problem in one thread.
Mar 13 '07 #3
r035198x
13,262 8TB
Help anyone... I'm creating a simple address book java program that would store 100 records. The GUI should be able to accept the name, address, phone no., and email add of a person by clicking a button named ADD. It should also be able to EDIT or DELETE a record and can VIEW ALL ENTRIES.

I have already INSTANTIATED the CLASS, and declared or created the necessary methods(accessor, mutator & constructors) and the arrays(container). I also already created the FORM and the necessary textfield and buttons in it, in a separate CLASS under the same package. The codes for the FORM was automatically generated by the IDE.

My problem is that, how am I going to make the GUI FORM work. Meaning to ADD, EDIT, DELETE or VIEW the entries.

These are the codes so far:
Expand|Select|Wrap|Line Numbers
  1. package addressbook1;
  2.  
  3. public class AddressBook1 {
  4.  
  5. private String name;
  6. private String address;
  7. private String telNum;
  8. private String emailAdd;
  9.  
  10. public AddressBook1(String name, String address, String telNum, String emailAdd){
  11. this.name = name;
  12. this.address = address;
  13. this.telNum = telNum;
  14. this.emailAdd = emailAdd;
  15. }
  16.  
  17. public String getName(){
  18. return name;
  19. }
  20. public String getAddress(){
  21. return address;
  22. }
  23. public String getTelNum(){
  24. return telNum;
  25. }
  26. public String getEmailAdd(){
  27. return emailAdd;
  28. }
  29.  
  30. public void setName(String tempName){
  31. name = tempName;
  32. }
  33. public void setAddress(String tempAddress){
  34. address = tempAddress;
  35. }
  36. public void setTelNum(String tempTelNum){
  37. telNum = tempTelNum;
  38. }
  39. public void setEmailAdd(String tempEmailAdd){
  40. emailAdd = tempEmailAdd;
  41. }
  42.  
  43. public static void main(String []args){
  44.  
  45. }
  46.  
  47. }

Due to limitation of text per discussion, I am posting the codes of the GUI FORM in another discussion titled "Address Book(con't)".


To make the actions work you need to implement the relevant actions. If you have buttons on the form then all you need to do is to addActionListeners to them and write the actions to be performed when the buttons are clicked.
Mar 13 '07 #4
To make the actions work you need to implement the relevant actions. If you have buttons on the form then all you need to do is to addActionListeners to them and write the actions to be performed when the buttons are clicked.

Can you give me the code for this? I mean, the codes for the actions to be made. Like for example, if I type a name on the TEXTFIELD on the FORM and click the ADD button, the name that I typed in will be added to the array for 100 records.

Thanks.
Mar 14 '07 #5
r035198x
13,262 8TB
Can you give me the code for this? I mean, the codes for the actions to be made. Like for example, if I type a name on the TEXTFIELD on the FORM and click the ADD button, the name that I typed in will be added to the array for 100 records.

Thanks.
I prefer that you write the code. You learn better that way.
It's not at all difficult. Just make sure the button has the correct listeners registered for it and override the actionPerformed method.
Mar 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: truckmen | last post by:
Hello All, I still can't figure it all out. I am trying to create a web page (using php) where: 1) A visitor add his or her name to an address book that can also be viewed online by other...
2
by: Phil Stanton | last post by:
Can anyone give me sone code to add addresses from a query to an Outlook Address book. The problem is that I want to add the new email addresses to a distribution list, not to the main email list ...
5
by: Ignacio Domínguez | last post by:
Hi. Is there a way of accessing the address book, similar to what Outlook Express does, using C#? Thanks Ignacio Domínguez
0
by: Bob Avallone | last post by:
MetaPro Systems Inc. Visual Studio Dot Net Tips & Tricks #3 – Direct Access to Your Outlook Address Book. Project Type: VS.NET Windows Application Code Behind: Visual Basic I have a project...
1
by: Rohan | last post by:
Hi There, I want o access address book of OUTLOOK EXPRESS on Web Clients PC so that he can select addresses from his address book & copy them to our database. Does Outlook Express support an...
11
by: MLH | last post by:
Anyone ever experiement importing WAB data directly into A97? Would lke a chance to look at any work done in this arena.
11
cjbrx3115
by: cjbrx3115 | last post by:
Hey guys- I just got this email from my friend. I'm not sure it will really work (it's a forward), so I'm askin' you people. Well, here it is: ...
1
by: Lpitt56 | last post by:
I am running MS Access 2007 and I want to update an Outlook Address book from my Access Database. I started out by importing the Outlook Address Book as a linked table and it linked fine. I then...
10
by: Mike Miller | last post by:
Hi, Am wanting to send email with php and need to access the global outlook address book. Are there any examples/tutorials on how to do this? M
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.