Hi ...i need to maintain a personal record using JAVA ..so please help

i need to store and display the personl records..
import java.awt.event.*;
import javax.swing.*;
class PersonalOrganiser1 extends JFrame implements ActionListener
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l4 = new JLabel("SEARCH");
JTextField tf3 = new JTextField(15);
JButton b1 = new JButton("ENTER");
JTextField tf4 = new JTextField(15);
JButton b2 = new JButton("RESET");
b1.setBounds(100,150,70,50);
b2.setBounds(100,170,90,40);
b1.add(b1);
b2.add(b2);
b1.addActionListener( );
b2.addActionListener( );
public class Business
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("HOME ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("OFFICE ADDRESS");
JTextArea tb = new JTextArea(3,2);
JLabel l4 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l5 = new JLabel("MOBILE NUM");
JTextField tf3 = new JTextField(10);
JLabel l6 = new JLabel("EMAIL-ID");
JTextField tf4 = new JTextField(10);
public class Friends
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("HOME ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("OFFICE ADDRESS");
JTextArea tb = new JTextArea(3,2);
JLabel l4 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l5 = new JLabel("MOBILE NUM");
JTextField tf3 = new JTextField(10);
JLabel l6 = new JLabel("EMAIL-ID");
JTextField tf4 = new JTextField(10);
public class Doctor
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("HOME ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("OFFICE ADDRESS");
JTextArea tb = new JTextArea(3,2);
JLabel l4 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l5 = new JLabel("MOBILE NUM");
JTextField tf3 = new JTextField(10);
JLabel l6 = new JLabel("EMAIL-ID");
JTextField tf4 = new JTextField(10);
class Kin
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("HOME ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l4 = new JLabel("OFFICE ADDRESS");
JTextArea tb = new JTextArea(3,2);
JLabel l5 = new JLabel("MOBILE NUM");
JTextField tf3 = new JTextField(10);
JLabel l6 = new JLabel("EMAIL-ID");
JTextField tf4 = new JTextField(10);
public void actionPerformed(ActionEvent ae)
String str = ae.getActionCommand( );
public static void main(String args[ ] )
MyButtons mb = new MyButtons( );
mb.setTitle("MY WEB PAGE");
mb.setSize(500,400);
mb.show( );
this one class
import javax.swing.*;
import java.awt.event.*;
class PersonalOrganiser extends JFrame implements ActionListener
JLabel l1 = new JLabel("NAME");
JTextField tf1 = new JTextField(15);
JLabel l2 = new JLabel("ADDRESS");
JTextArea ta = new JTextArea(3,2);
JLabel l3 = new JLabel("TEL NUM");
JTextField tf2 = new JTextField(15);
JLabel l4 = new JLabel("SEARCH");
JTextField tf3 = new JTextField(15);
JButton b1 = new JButton("ENTER");
JTextField tf3 = new JTextField(15);
JButton b2 = new JButton("RESET");
b1.setBounds(100,150,70,50);
b2.setBounds(100,170,90,40);
add(b1);
add(b2);
b1.addActionListener( );
b2.addActionListener( );
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
class Business extends PersonalOrganiser
class Friends extends PersonalOrganiser1
public void actionPerformed(ActionEvent ae)
String str = ae.getActionCommand( );
public static void main(String args[ ] )
MyButtons mb = new MyButtons( );
mb.setTitle("My webpage");
mb.setSize(500,400);
mb.show( );
}

What are you doing ? Show this to your professor so he can seee what a failure he has been and so he can smack you.
This is not java, I feel for you for the fact you actually typed all this out; either that or one of your classmates is playing a serious joke on you.
forget about the visual stuff and create a class that can actually store and manipulate data first.
this is probably too advanced and will make you cry but here goes
public class Contacts implements serializable {
     public int search (String First, String Last) {
      //cycle throug htablemodel and check for first and last name
      //return row;   the row in TableModel the record was found at
     public String [] getRecord (int row) {
          int num_of_cols = records.getColumnCount();
           String [] temp = new String [num_of_cols];
                      for (int c = 0; c < num_of_cols; c++){
                        temp [c] = (String) records.getValueAt(row, c);
       return temp;  
    public void addRecord (String [] record) {
        records.addRow(record);
public void save (String filename) {
        try {
            ObjectOutput out = new ObjectOutputStream(new FileOutputStream(filename));
            out.writeObject(this);
            out.close();
        } catch (Exception e) { e.printStackTrace(); }
private javax.swing.table.DefaultTableModel records = new DefaultTableModel ();  //<-----this holds the data
in your main() you use it like this
File file = new File (filename);
if (!file.exsists())  Contacts friends = new Contacts();
else {
try {
                File file = new File(filename);
                ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
                // Deserialize the object
                Contacts friends = in.readObject();
                in.close(); return temp;
            } catch (Exception e) { e.printStackTrace();  }
//this is where you would need a visual object to gather real data and plug it into the String [] array
String [] friend = new String [3] = {"Joe", "Smith", "555-1212"};
friends.addRecord(friend);
String [] temp = friends.getRecord(friends.search ("Joe", "Smith"));
//now you have data to display from file
freinds.save("Freinds.dat");

Similar Messages

  • I have lost my iphone 4 just an hour ago... i need to delete my personal photos from it. PLease help urgently.. Thanks

    I have lost my iphone 4 just an hour ago... i need to delete my personal photos from it. PLease help urgently.. Thanks

    If you had find my iphone enabled follow the steps in the article below:
    http://support.apple.com/kb/ph2701

  • Going to the next record using Iterators. Please HELP

    No offence meant for asking again as this is URGENT.
    I am unable to go to the next record.
    I need to go to the next record using the RowsetIteratorTag.
    But am getting the null pointer exception.
    Please can anyone tell me the way to go to the next record.
    I AM USING THE NEXT(),BUT STILL NO LUCK
    public class CheckDetailRowsIterate extends TagSupport
         public int doStartTag() throws JspException
           Row currentRow = null;
           Row nextRow = null;
           String m_CmpyCode;
           // Find the current row and get Data out of it.
           RowsetIterateTag detailIterator = (RowsetIterateTag)TagSupport.findAncestorWithClass(this, RowsetIterateTag.class);
           if (detailIterator != null)
              currentRow = detailIterator.getRow();
           else
               // No row iterator
               log.logDebug(ClassName,"","No CURRENT ROW Found : ");
           if(currentRow != null)
             String[] attrNames = currentRow.getAttributeNames();
             Object[] obj = currentRow.getAttributeValues();
             // Get the attribute Values
             m_CmpyCode = obj[currentRow.getAttributeIndexOf("CmpyCode")].toString();
            /* Now,move to the next Row.GIVES NULL POINTER EXCEPTION.
            RowSet rowSet = new IT().getRowSet();
            nextRow = rowSet.next();
            m_CmpyCode = obj[nextRow.getAttributeIndexOf("CmpyCode")].toString();
            log.logDebug(ClassName,"","NEXT ROW Values ARE "     + m_CmpyCode );
            rowSet = null;
            return Tag.SKIP_BODY;
         public class IT extends RowsetIterateTag
                 RowSet getRowSet()
                      return rs;
    }  // End class.

    You cannot look for a duplicate record situation using a timer. When you issue the Raise Form_trigger_failure from the when-timer-expired trigger, all it does is stops that trigger. The when-validate trigger has already run and completed with success, before the when-timer-expired trigger even started.
    You must do the checking and raise form_trigger_failure at the same time from the When-validate-record trigger.
    In fact, you don't even need to Post; first. In the WVR trigger, just do this:
    If :System.Record_Status = 'INSERT', then do the select.
    Then, if v_counter >= 1, issue the message and Raise Form_Trigger_Failure;

  • Need Sample Code for Vendor creation using JAVA API

    Hi,
    I have a scenario like Vendor creation using <b>Java API</b>.
    1.I have Vendors (Main) Table.
    2.I have <b>look up</b> tables like Account Group.
    3.Also <b>Qualifier table</b>(Phone numbers) too.
    Could you please give me the sample code which helps me to create Vendor records using Java API?
    <b>I need Code samples which should cover all of the above scenario.</b>
    <b>Marks will be given for the relevent answers.</b>
    Best Regards
    PK Devaraj

    Hi Devraj,
    I hope the below code might solve all your problem:-
    //Adding Qualified field
    //Creating empty record in Qualifed table 
    //Adding No Qualifiers
    Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
    try {
    qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
    catch (IllegalArgumentException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    catch (MdmValueTypeException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    //Creating Record in Qualified table
    CreateRecordCommand create_command = new CreateRecordCommand(connections);
    create_command.setSession(sessionId);
    create_command.setRecord(qualified_record);
    try
    create_command.execute();
    catch(Exception e)
    System.out.println(e.toString());
    RecordId record_id = create_command.getRecord().getId();
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue lookup_value = new QualifiedLookupValue();
    int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
    //Adding Yes Qualifiers
    lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
    //Now adding LookUP values
    //Fetch the RecordID of the value selected by user using the following function
    public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
    ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
    rsd.addSelectField(new FieldId(Fieldid));
    StringValue [] val = new StringValue[1];
    val[0] = new StringValue(value);
    RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
    val_command.setSession(sessionID);
    val_command.setResultDefinition(rsd);
    val_command.setFieldId(new FieldId(Fieldid));
    val_command.setFieldValues(val);
    try
         val_command.execute();
    catch(Exception e)
    RecordResultSet result_set = val_command.getRecords();
    RecordId id = null;
    if(result_set.getCount()>0)
         for(int i = 0 ; i < result_set.getCount() ; i++)
         id = result_set.getRecord(i).getId();     
    return id;
    //Finally creating the record in Main table
    com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
    try {
         empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
         empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
    empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp  value Retrieved above
    } catch (IllegalArgumentException e1) {
    // TODO Auto-generated catch block
         e1.printStackTrace();
    } catch (MdmValueTypeException e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
    //Actually creating the record in Main table
    CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
    create_main_command.setSession(sessionId);
    create_main_command.setRecord(empty_record);
    try
         create_main_command.execute();
    catch(Exception e)
         System.out.println(e.toString());
    Thanks
    Namrata

  • I need to create  .pst  ext . file using java,whi will import in ms outlook

    {color:#ff0000}*I need to create .PST extension file using java which will be able to import in ms outlook,and that .pst file will contain root folder (like Personal Folders) and inbox,sent mail*{color}
    give me some hint It is essential task .we have to implement code in  java

    I'm using the thin drivers.
    The answer to your question is no, you do not need to create a DSN to connect to Oracle. The Oracle thin driver is all that is required. Your code looks OK to me, I'm assuming that you xxx'd out the IP, and that you are using a real IP in the actual code.
    The message you got back is pretty generic, but can indicate that the Oracle database listener isn't available. Perhaps the database is on a different port, or perhaps the listerner isn't running. Perhaps you have the IP address wrong.
    So, to be very basic:
    1) Can you ping the server you are trying to connect to? This makes sure you are using a valid IP address.
    2) Can you connect to the Oracle server from an Oracle client? This makes sure the listener is running properly, and that you know the correct port number and login information (The port number could be in a local or server based TNS file, or available through an Oracle names server. You might try using the program tnsping if it is available on the client for validation.
    3) If you can do 1 and 2, then be sure you are using the same connection parameters (server, port userid and password) that worked with 2.
    4) Verify that you are using (pointing to) the correct set of Oracle classes for the thin connection. This can be tricky if you have different versions of Oracle on the client then on the server, but is documented on the Oracle website.
    5) If everything checks out, you might want to verify that you are using the most recent versions of the thin drivers, including the Oracle patches.
    Hope it helps - good luck,
    Joel

  • I have Windows Vista and my iTunes is v 10.5, I have an iPhone 3GS and an iPhone 4. Everytime i try to update my phone to iOS5 it stops on Backing up and freezes. What can i do? Do i need to upgrade my phones on a Mac? Please help!

                        I have Windows Vista and my iTunes is v10.5, I have and iPhone 3GS and an iPhone 4. Everytime i try to update my phone to iOS5 it stops on Backing up and freezes. What can i do? Do i need t upgrade my phones on a Mac? Please help it would be greatly appreciated.

    Your expectations are not based in reality.
    Your G4 will not run iCloud. There will be no upgrade from Mobile Me to iCloud for you with that machine unless you do it manually, and only mail will work without further expenditure.

  • Hello, Our indesign file keeps crashing and we need to go to print today. We use CS6. Please help!

    Hello, Our indesign file keeps crashing and we need to go to print today. We use CS6. Please help!

    Ok - we're going to need a few more details.
    Operating System - Windows or Mac?
    Version of CS6 - are you fully patched to the latest version (Help>Updates)?
    Do you use any 3rd Party Plugins (Help>Manage Extensions and look for 3rd Party Plugins)
    At what point does it crash? How are you exorting/printing?
    What file type or action are you doing when it's crashing?
    Common Troubleshooting tips
    Troubleshooting 101: Replace, or "trash" your InDesign preferences
    https://forums.adobe.com/thread/526991
    File Crashing on Output - printing/PDF/other

  • How to create a apple ID without credit card needed i want a none credit card.. Please help me... Thank you hope u replied as soon as possible.. Thank you again..

    How to create a apple ID without credit card needed i want a none credit card.. Please help me... Thank you hope u replied as soon as possible.. Thank you again..

    Hello, chard2say22. 
    Thank you for visiting Apple Support Communities.
    To create an Apple ID without a credit or debit card, there is a specific series of steps that have to be processed in order to allow the payment to be set as none on creation of the account.
    Creating an iTunes Store, App Store, iBooks Store, and Mac App Store account without a credit card
    http://support.apple.com/kb/HT2534
    If the specific steps have not been processed, a credit or debit card will be required to complete the setup of the account.
    However, it can be removed and payment method changed to none as long as there is not an outstanding balance.  At this point an iTunes gift card can be used as form of payment.
    iTunes Store: Changing account information
    http://support.apple.com/kb/ht1918
    Cheers,
    Jason H.

  • TS2755 I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    Hi there
    I’d be happy to help with this messaging error! This will be due to the device storing the number incorrectly. Please do the following to resolve the issue:
    Delete texts from both old number and new
    Delete any call logs including these numbers
    Delete old number from contacts
    Delete new number from contacts
    Restart device
    Send text to the new number directly (do not save as contact)
    Once the text sends successfully, you can then save as a new contact
    I hope this helps!
    Charise

  • I have an iphone 4 and trying to upgrade ios 6, downloaded the version and when trying to install get an error that i need internet, i have internet of course... please help...

    I have an iphone 4 and trying to upgrade ios 6, downloaded the version and when trying to install get an error that i need internet, i have internet of course... please help...

    C Mawle wrote:
    Thanks.  I have followed all the instructions as recommended and nothing has worked so it looks like the restore/update may have been interrupted - would loss of internet connection do this?
    Yes it would, possibly even brick it.
    Have successfully connected my ipod nano with iTunes so looks like the device driver is working.
    Can I use my ipod nano USB connector to check?
    It is not much help to you, since the device that you need still not recognized.
    Anyway looks like I may have to swallow the loss of data.  Have set-up a call for tomorrow with Apple support so will wait until after this before doing the factory restore!
    Good luck, but if you expect miracle from that call good luck again.

  • Hello everyone, i need Mongolian keyboard layout, how can i find it, please help me, my pc is version OS X Yosemite, 10.10.2

    hello everyone, i need Mongolian keyboard layout, how can i find it, please help me, my pc is version OS X Yosemite, 10.10.2

    CLICKY CLICK---> Multilingual Mac

  • HT201328 my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    froggy_vic wrote:
    so even if your phone is unlocked you wouldn't be able to use it anywhere else.
    Absolutely not true. There is no difference, spec wise, between the iPhone sold in Japan & the GSM iPhone sold everywhere else. iPhones in Japan use UMTS 2100.

  • Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    I think you misunderstood the guy. The up-to-date program isn't working for a lot of people. I'm eligible for the free upgrade but it fails to recognise my serial. From what I've read, this is affecting a lot of people who purchased their computers online. Apple seems to be fixing the issue though, so my advice would be to keep trying. Alternatively, click on the manual verificaton link so they can check your order for you and send the redemption code after they do.

  • I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    Thanks for your response. I do believe I have the information needed for each form on a separate line in Excel. There is a first name, middle name, last name, city, and zip column. And field is entered on a different line for all the information. I'm really stuck.

  • Very frustrated.  downloaded reader but when I try to download pop up box says I have to accept end user license agreement but there is no place to accept it at.  I need to download pdf asap for my business.  Please help.

    very frustrated.  downloaded reader but when I try to download pop up box says I have to accept end user license agreement but there is no place to accept it at.  I need to download pdf asap for my business.  Please help.

    Hi Pat.  I've done that, it opens up the install window again.  If I click on install it says it's already installed.  Nothing comes up that allows me to accept the end user agreement.  I just retried and the same thing happens.
    I appreciate your help. 
    Shelley

Maybe you are looking for