473,785 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Address Book

9 New Member
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(accesso r, mutator & constructors) and the arrays(containe r). 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 4033
ttoboobz
9 New Member
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 MVP
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 MVP
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(accesso r, mutator & constructors) and the arrays(containe r). 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 addActionListen ers to them and write the actions to be performed when the buttons are clicked.
Mar 13 '07 #4
ttoboobz
9 New Member
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 addActionListen ers 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 MVP
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
2387
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 visitors to the website.
2
2543
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 TIA Phil
5
10469
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
3987
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 where I needed to access my Outlook Address book directly. This is possible but very tricky. I got it to work and I would like to share it with you. Thanks go to Jim Lennox of Scientific
1
1614
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 object model? if yes where do I get help on it. If No ? How do I achieve this task? pls help
11
2318
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
2453
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: ----------------------------------------------------------------------------------------------- HOW TO PROTECT YOUR ADDRESS BOOK I learned a computer trick today that's really ingenious in its simplicity.
1
2883
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 built a query to filter a master contact list of contacts and I made it an append query to added to the linked Outlook address book table. However, I am getting an error message that says I do not have the necessary permissions to use this object. At...
10
6922
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
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10092
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.