Need help creating component with 'application.createComponent'

I am trying to create a button component by doing the following
application.createcomponent("javax.faces.command") ;
However it does not seem to work. I can create pretty much any other component by this method but for some reason I am unable to do this with the 'javax.faces.command' component family. Shouldn't this work?

I think that the component type of the commandButton is "javax.faces.HtmlCommandButton"

Similar Messages

  • I need help creating documents with framemaker 9

    I have been using Words for all the manuals that i have created and i need to transfer them into framemaker and then be able to rewrite them directly into framemaker. I need some help with that please

    Anna,
    You might want to have a peak at some of these tutorials and papers:
    http://www.adobe.com/devnet/framemaker/articles/word_conversion.html
    http://www.techknowledgecorp.com/public/word2frame.pdf
    http://www.io.com/~tcm/etwr2472/guides/frame/frame6/frame_conversion6.html
    http://www.ivanwalsh.com/2009/10/how-to-convert-microsoft-word-documents-into-adobe-framem aker/
    There's also an online webinar [nominal fee] coming up on Feb.10th presented by Shlomo Perets that will be covering this topic. [Highly recommend]
    See: http://www.microtype.com/training.html#ImproveFM

  • Need Help creating form with checkboxes

    I am using Acrobat Standar 9, and I am trying to create a form that has a bunch of checkboxes on it.  First off, the PDF that I am workin with (before I try to input form stuff) is a check list that has spots for marking (if it was printed out).  Acrobat will recognize all of those places as spots for a form tool, but it always inserts textboxes.  I want it to insert check boxes.  So far all I can do is delete all of the textboxes that were inserted and manually, one by one, insert check boxes in all of the locations.
    Is there a way to make the wizard input checkboxes instead of text boxes?  If not with the wizard, is there any way to do that?  (I am not familier with programming languages.. fyi)
    thanks

    Thanks for getting back to me. What I have is a pricing page. The feedback form is so we can see who views or is interested in services. We want only people who fill out this form to be able to view it. I have created simple contact forms that are sent to an email and directed to another page. The problem I am having is trying to figure a way to where hopefully if the same person comes back they won't have to fill out the form again. I know if they fill out the form and create a user name/login it could be a possible fix but I am trying to make it simple. I am just starting to learn PHP/XML (which I have copied from another sources) and haven't written my own. Maybe creating a cookie that is checked once the page is loaded? I have no idea how to do that either though... I am a front end "designer" and a lot of this is greek to me.

  • Newbie needs help creating folder with different date buckets

    A simplification my scenario, I have a table, Invoice, which contains invoice amounts and invoice dates. I want to break up the invoices amounts into date buckets, such that my target report should look something like this:
    Invoices<30 Invoices<60 Invoices<90 Invoices>90
    $100 $250 $500 $1000
    I have created a folder from the Invoice table, and would like to know if it is possible to create new items within this folder to allow me to sum invoice amounts over the 0-30, 30-60, 60-90, 90+ invoice date ranges. In other words, can I create new items that each have their own condition?
    I have seen other solutions that use a custom folder backed by a SQL query using case statements to break a table down into its date range buckets. Is this considered the "right" approach to the problem?
    A simpler solution I've thought of is creating a folder for each date range (Invoices30, Invoices60, etc), and setting the condition of the folder to do the date filtering. The item "Invoice Amount" in each folder ends up being the bucket I want, and I would put them together in a complex folder, and build the report off the complex folder. Although inelegant and a bit redundant, would this solution work?
    Thanks everybody!

    Hi Newbie
    You can do this right inside Discoverer using a couple of calculations.
    Calc 1:
    =====
    Calculate the invoice date variance, let's say you will use TRUNC(SYSDATE) - TRUNC(INVOICE DATE). This gives you a number and let's call this new calculation VARIANCE.
    Calc 2:
    =====
    This second calculation created the buckets themself. Let's do it using a CASE statement and we'll call the calculation TIME BUCKET.
    CASE
    WHEN VARIANCE <= 30 THEN "0 to 30"
    WHEN VARIANCE <= 60 THEN "30 to 60"
    WHEN VARIANCE <= 90 THEN "60 to 90"
    ELSE "More than 90"
    END
    You now display only TIME BUCKET in your workbook. The other calculation, VARIANCE, will be used but not displayed on screen in the final answer.
    If you don't like CASE, here's the same answer using DECODE:
    DECODE(VARIANCE,
    LEAST(VARIANCE,30), "0 to 30",
    LEAST(VARIANCE,60), "30 to 60",
    LEAST(VARIANCE,90), "60 to 90","More than 90")
    By the way, when you do this you will find that Discoverer runs your report very fast. This is because it can handle these types of queries exceptionally well.
    I hope this helps
    Regards
    Michael

  • Need help creating trigger with delete capabilities

    I have two tables:
    create table person(userid integer,
    lname varchar(20),
    fname varchar (20),
    phone_number varchar(12),
    email_address varchar(35),
    city varchar(20),
    zip_code varchar(20),
    department varchar(20),
    major_street varchar(20),
    cross_street varchar(20),
    notes varchar(100),
    Primary Key (userid));
    create table vehicle(car_id integer,
    make varchar(15),
    model varchar(20),
    year integer,
    gas_mileage integer,
    capacity integer,
    owner integer,
    primary key (car_id),
    foreign key (owner) references person (userid));
    I am trying to create a trigger that would delete all those records in vehicle whenever someone deletes a record in the person table. Here is the code that I run but it get a compilation error. Here is the the trigger text followed by the error:
    CREATE OR REPLACE TRIGGER ON_DELETE_PERSON
    AFTER DELETE ON person FOR EACH ROW
    BEGIN
    DELETE from vehicle
    where owner=userId;
    END;
    2/4 PL/SQL: SQL Statement ignored
    3/19 PL/SQL: ORA-00904: "USERID": invalid identifier
    Any suggestions?

    CREATE OR REPLACE TRIGGER ON_DELETE_PERSON
    BEFORE DELETE ON person FOR EACH ROW
    BEGIN
    DELETE from vehicle
    where owner=:old.userId;
    END;

  • Need tech help creating project with PE11, Windows 7

    I still need help creating a slideshow set to music for DVD playback at my 50th high school reunion. 
    Video Media = 700 still images in .jpg or .tff format.  Pixel sizes range from 200x200 to over 3000x4000.
    I first created this project using PE's presets and original image sizes.  Images added to PE were more blurred than originals & images burned to DVD were even more blurred so I asked for advice.
    Last week several people in the forum tried to help.  I really appreciate everyone's suggestions but would still appreciate further advice. 
    Forum experts said to restart my project with project settings changed to DV 720x480...and to resize my images to 1000x750 pixels.  Then today in a PE11 chat session, I was told something different: use project settings changed to DVD 720p 30 and resize only larger images down to 1280 x 720 (leave smaller images alone). 
    So what project settings and resizing should I use for better image clarity?  How do I change project settings?  By clicking on "new" under "file" >change project settings >DVD 720p 30 or something else?

    Up-rezzing small Still Images, regardless of the program and the Scaling algorithm used, can lead to a diminished quality. As Steve says, pixels are created, where none existed. I try to stay away from up-rezzing, whenever possible, due to that diminished qualtiy.
    If I have to work with very small Images, I often use another workflow, and a different asethetic choice. When faced with the prospect of using small Images, I will create a background of some sort (many options here), and then use that small Image at its original size, "framed" within that background - no Scaling involved, but obviously, that small Image will not fill the screen. The viewer usually has fewer problems with the small Image, than one that is larger, but has started to fall apart, due to the up-rezzing.
    One "trick" that I use is to use that small Image AS the background, but alter it greatly, probably dropping its contrast and upping its brightness, and even adding a Blur to it, then do a PiP (Picture in Picture) of the Image at its original size. I might even create a "picture frame" in Photoshop, to really set that small Image apart from the background. That is but one of dozens of such possible treatments, and one is only limited by their imagination.
    Another possible treatment would be to do a "photo wall" with several of the small Images in say a 3 x 2 matrix of PiP's. Sort of like a Contact Sheet.
    Good luck,
    Hunt

  • Uber Noob Needs Help Creating website!

    I need help creating my webpage: It has a textbox on it were
    the user enters a URL and it then redirects the end user to that
    URL when they press the GO Button. It also has a check box saying
    "Hide my IP", If the end user clicks this box and then clicks go
    they will be directed to the website they stateted in the Textbox
    but this time it shall mask there IP Address so they can bypass
    proxys and surf anonomosly. Please can someone give me some HTML
    code i could use for this site or a Link to a website that can give
    me the code.

    I assume the application is connecting to Oracle using an application ID/password. If so, check to see if that user has a private synonyn to the table. If so drop it since you have a public synonym.
    Verify that the public synonym is in fact correct. Drop and recreate the public synonym if you cannot select against the synonym name using an ID that can perform select * from inhouse.icltm where rownum = 1. That is if this other user cannot issue select * from icltm where rownum = 1 without an error.
    Check that the application ID has the necessary object privileges on the table.
    Queries you need
    select * from dba_synonyms
    where table_owner = 'INHOUSE'
    and table_name = 'ICLTM'
    You may find both public and private synonms. Either fix or delete. (Some may reference someelses.icltm table if one exists)
    select * from dba_tab_privs
    where table_name = 'ICLTM'
    and owner = 'INHOUSE'
    Note - it is possible to create mixed case or lower case object names in Oracle by using double quotes around the name. Do not do this, but do look to see that this was not done.
    You could also query dba_objects for all object types that have the object_name = 'ICLTM'
    HTH -- Mark D Powell --

  • How to configure oracle 6i report server run time component with application server

    we got oracle 6i report server for developing the web based reports for our undergoing product. we r succesed in developing the web based reports using oracle 6i report server.But we r facing problems while deploying the product with oracle reports at clients place,why because the client does not have the oracle 6i report server. To solve this problem we have to configure the oracle 6i report server run time component with application server at client side , but we are unable to configure this component(that is CGI handler).

    You can run multiple instances of Reports Server in 6i.
    In tnsnames.ora, for each server, have a different name and each listening to different port.
    For example,
    server1.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1949))
    server2.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1950))
    Also, if you want to know about Reports Server Clustering, you may refer to "Publishing Reports" document on OTN:
    http://otn.oracle.com/docs/products/reports/pdf/A73173_01.pdf

  • Need help opening new software application Adobe Elements 12 on my new MAC. HELP?

    Need help opening new software application Adobe Elements 12 on my new MAC. HELP?

    Is it installed? If so, go to Applications and choose either Adobe Elements 12 Organizer, or Adobe Photoshop Elements 12>Support Files>Photoshop Elements Editor.

  • Need help displaying images with List component for Flash CS4 (ActionScript 3.0)

    Hi folks:
    I am an inexperienced user of Flash CS4 Pro (v10.0.2). I am attempting to use the List component with ActionScript 3.0 to make a different image display when a user clicks each item in a list.
    I did find a tutorial that showed me how to make different text display using a dynamic text box and the following ActionScript:
    MyList.addEventListener(Event.CHANGE, ShowSelectedItem);
    function ShowSelectedItem(event:Event):void {
        ListText.text=MyList.selectedItem.data;
    ...where My List is the instance of the List component and ListText is the dynamix text box. In this case, the user clicks an item in the list, defined by the label value in the dataProvider parameter of the List component, and text displays as defined in the data value in the dataProvider parameter.
    However, as I mentioned to start, what I really want to do is make images display instead of text. Can anyone provide me the steps to do this?
    I appreciate your help (in advance)!!
    Cindy

    Hi...thanks for responding! I was planning on using images from the Library, but if there is a better way to do it, I'm open. So far, I just have text in the data property. This is part of my problem. I don't know what I need to put in the data value for an image to display. Do I just put the image file name and Flash will know to pull it from the Library? Do I need to place the images on the stage on different frames? I apologize for the "stupid user" questions, but as you can tell, I'm a newbie.
    Appreciate your patience and any help you can offer!
    Cindy

  • Need help creating a layered component

    I'm trying to create a component with one to sixteen layers of graphics in it, and I can't work out how to! The ideas I've had so far involved creating several images, adding graphics objects to them etc., and painting each individualy, and then painting them all to the main component. But the idea I came up with today seems smarter - actually make the component consist of sixteen (or less) other components, on top of one another. The only problem with this is that I don't know how to put one component onto another, and I don't know how to make sure they're in the right order (i.e. the foreground image is displayed above the background one).
    If anyone has any suggestions/links for this - or an alternative solution to my problems - please post!
    Thanks -
    K

    Sounds like you need to use Layered Panes:
    http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html

  • Need help creating a rectangle with a bunch of  text scrolling up within it

    Hey everyone, I'm using Motion 2 and want to add a large amount of text scrolling up. Which behavior would be best to use, the Scroll up or Motion Path?
    I want to create a rectangle where the text will be scrolling within it but I'm not sure how to do that. I'm I suppose to create a mask rectangle and then add the text?
    Please help
    Thank You

    As with most things there are a number of ways you could do it.
    One way is, if your making a rectangle anyway (as a bkg for the text) you can make an image mask (command shift m) on the text object and drag the rectangle into the mask well (then turn the rectangles visibility back on). This works with a filled rectangle.
    Of course you have to format the text to fit in the rectangle as it won't act as a bounding type area (like in AI, PSD).
    o| TOnyTOny |o

  • Need help creating script to clear data with user inputs

    Hi experts.
    I need to create a script to clear data in a DEV system from a particular junction.
    Basically, I need the user to enter a CATEGORY, ENTITY and TIME which will then be used to delete all data in a particular table which meetes those criteria.
    I tried to write it in SSIS, but can't get a user input box.
    Also, Stored Procedures are not designed to open input boxes for these entries.
    Therefore, is there a way to do this in BPC script logic?
    I believe that I might be able to write either a Stored Procedure or DTSX package and then pass data from BPC Run Package?
    If this is correct, how would I go about it?
    Also, would it be possible to read the DISTINCT entries for Category, Time and Entity and present as a dropdown list?  (It doesn't matter too much if not, a manual entry would have to do).
    I will admit that I have no experience of script logc, so any docments and/or pointers would be appreciated.
    Thanks

    Thank Karthik, but I can't use the clear for this job.
    Specifically, I need this to delete from the LCK tables whenever data gets stuck, so if anyone can tell me the format to use, I'd be extremely grateful
    (And I appreciate that this is not recommended, but it's a DEV system and we need a way to clear these locks quickly when they occur)
    Edited by: Pie Eyed on Oct 1, 2011 2:54 PM

  • Need help to start with some file and text manipulation

    Hello script mavens,
    I need help with starting a script that does the following:
    -within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    -moves all the files into the images folder
    -within the base folder it creates a new text file and calls it imagesX.js
    -writes a "//-" into imagesX.js
    -then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -from a folder a level above the base folder it copies a file called index.html into the base folder and renames in indexX.html
    -in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    The task is more complex but this would help me tremendously do the rest.
    If I am asking for too much on this forum please let me know

    This should get you started.
    The description of how you want to write the data isn't clear, but the rest should work (untested):
    property imageNum : 0 -- last used ImageNumber
    -- within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -- get the folder:
    set baseFolder to (choose folder)
    -- now get the files within it:
    tell application "Finder"
    set fileList to every file of folder baseFolder as alias list
    end tell
    --creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    tell application "Finder"
    set imageNum to imageNum + 1
    set newImageFolder to make new folder at baseFolder with properties {name:"images" & imageNum}
    -- moves all the files into the images folder
    move every file of folder baseFolder to newImageFolder
    --within the base folder it creates a new text file and calls it imagesX.js
    set textFile to (open for access file (baseFolder as text) & "images" & imageNum & ".js" with write permission)
    --writes a "//-" into imagesX.js
    write "//-" to textFile
    -- then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -- need more info here
    -- a blank line between each instance of the file name? or all file names, blank line, all file names again?
    -- an example, please
    close access textFile
    --from a folder a level above the base folder it copies a file called index.html into the base folder
    --and renames in indexX.html
    --in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    -- the easiest way of doing this is to read the file and write a new copy with the changes - that's easier than changing it in situ:
    set indexHTML to (read file "index.html" of folder (container of baseFolder))
    set {oldTIDs, my text item delimiters} to {my text item delimiters, "replaceThis"}
    set indexHTML to text items of indexHTML
    set my text item delimiters to "imagesX.js"
    set indexHTML to indexHTML as text
    set my text item delimiters to oldTIDs
    set indexFile to (open for access file ("index" & imageNum & ".html") with write permission)
    write indexHTML to indexFile
    close access indexFile
    end tell

  • Need help creating a Jframe

    Hi guys, need a little help here in creating a Jframe. Its not something I am knowledgeable at all with and I need this done for my Introductory Java class. I have the other parts of the program finished as best as I can get it. I will post the problem and my code so you guys can look at it and maybe help me out. All help is appreciated
    Problem:
    Congratulations, your fame as a Java programmer is spreading, and you have been hired by Intelecom Group to create a special application. Using multiple classes design an online address book to keep track of the names, addresses, phone numbers, and birthdays of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries. This program should load the data from a file, called phoneData.txt.
    User Interface: Using JFrame, create a user interface of your design. Remember, unless notified otherwise, ALL input and output will be via this interface.
    Functionality: The program should be able to do the following:
    a) Search for all of the names and phone numbers by first letter of the last name, (this can be displayed using a message box)
    b) Search for a particular person by last name, displaying their phone number, address, and date of birth.
    c) Display the names of people whose birthday's are in a given month.
    d) Search for a person by their phone number, displaying their name, address, and their relationship (ie. Family, Friend, or Associate
    Code:
    package back_end;
    import java.util.*;
    public class Test_backend
    * @param args
    public static void main(String[] args)
    //Relation_type FRIEND;
    // TODO Auto-generated method stub
    Birthday b1 = new Birthday(9,2,1985);
    Birthday b2 = new Birthday(6,21,1985);
    Birthday b3 = new Birthday(1,2,1990);
    Birthday b4 = new Birthday(1,3,1950);
    Person p1 = new Person ("Sloan", "Mergler", "4 vanderbilt drive",
    "516-551-0829", b1, Relation_type.FRIEND );
    Person p2 = new Person ("Taylor", "Bowne", "21 greywood street",
    "516-944-6812", b2, Relation_type.FRIEND);
    // these are random numbers for birthdays
    Person p3 = new Person ("Daniel", "Py", "21 roger drive apt 2",
    "516-944-7530", b3, Relation_type.FAMILY_MEMBER);
    Person p4 = new Person ("Richard", "Py", "21 roger drive apt 1",
    "516-944-7530", b4, Relation_type.FAMILY_MEMBER);
    Address_book a1 = new Address_book();
    a1.add_to_book(p1);
    a1.add_to_book(p2);
    a1.add_to_book(p3);
    a1.add_to_book(p4);
    System.out.println("This is testing search_by_last_initial");
    Vector vt1a = a1.search_by_last_initial("M");
    Test_backend.printOutVector(vt1a);
    System.out.println("Sloan Mergler should be : ");
    Vector vt1b = a1.search_by_last_initial("P");
    Test_backend.printOutVector(vt1b);
    System.out.println("Daniel Py and Richard Py should be :");
    System.out.println("This is testing search_by_last_Name");
    Person lastname1 = a1.search_by_last_name("Mergler");
    System.out.println(lastname1.first_name + " " + lastname1.last_name +
    " should be Sloan Mergler " );
    Person lastname2 = a1.search_by_last_name("Bowne");
    System.out.println(lastname2.first_name + " " + lastname2.last_name +
    "should be Taylor Bowne" );
    System.out.println("This is testing search_by_birth_month");
    Vector vt3a = a1.search_by_birth_month(1);
    Test_backend.printOutVector(vt3a);
    System.out.println("should be Daniel Py and Richard Py");
    Vector vt3b = a1.search_by_birth_month(6);
    Test_backend.printOutVector(vt3b);
    System.out.println("should be Taylor Bowne");
    System.out.println("This is testing search_by_phone_number");
    Person pt4a = a1.search_by_phone_number("516-944-7530");
    System.out.println(pt4a.first_name + " " + pt4a.last_name +
    " should be Daniel Py");
    Person pt4b = a1.search_by_phone_number("516-551-0829");
    System.out.println(pt4b.first_name + " " + pt4b.last_name +
    " should be Sloan Mergler");
    public static void printOutVector(Vector v1)
    for (int x = 0; x < v1.size(); x++)
    Person p1 = (Person) v1.get(x);
    String s1 = p1.first_name +" " + p1.last_name + "";
    System.out.println(s1);
    return;
    package back_end;
    public enum Relation_type
    FAMILY_MEMBER,
    FRIEND,
    BUSINESS_ASSOCIATE
    package back_end;
    public class Person
    String first_name;
    String last_name;
    String address;
    String phoneNumber;
    Birthday birthday;
    Relation_type relation;
    public Person (String first_name, String last_name, String address, String phoneNumber, Birthday birthday, Relation_type relation)
    this.first_name = first_name;
    this.last_name = last_name;
    this.address = address;
    this.phoneNumber = phoneNumber;
    this.birthday = birthday;
    this.relation = relation;
    // default constructor
    public Person (){}
    package back_end;
    public class Birthday
    int birth_month;
    int birth_day;
    int birth_year;
    Birthday(int birth_month, int birth_day, int birth_year)
    this.birth_month = birth_month;
    this.birth_day = birth_day;
    this.birth_year = birth_year;
    package back_end;
    import java.util.*;
    * This class is the addressbook, it is to keep track of all your associates
    public class Address_book
    int MAX_SIZE = 500;
    public ArrayList book;
    // constructor
    public Address_book()
    this.book = new ArrayList(MAX_SIZE);
    // methods
    public void add_to_book(Person newPerson)
    boolean it_worked = this.book.add(newPerson);
    if (it_worked){ return ;}
    else
    throw new RuntimeException ("Too many items in book, it is filled up");
    * Functionality for this class
    * a) Search for all of the names and phone numbers by first letter of
    * last name (this can be displayed in a message box).
    * b) Search for a particular person by last name, displaying their
    * phone number, address, and date of birth.
    * c) Display the names of people whose birthdays are in a given month.
    * d) Search for a person by phone number, displaying their name,
    * address, and their relationship (ie Family, Friend, or Associate).
    * This method shold work for functionality part a
    * Given a string containing one letter, this function will search through
    * this and try to find all occurances of people whose last name start
    * with the given string and return it in a vector
    public Vector search_by_last_initial (final String last_initial)
    // this is for input error checking
    if (last_initial.length() != 1){
    throw new RuntimeException("Input was not supposed to be that long");
    Vector v1 = new Vector();
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.last_name.startsWith(last_initial))
    v1.add( listed_person);
    return v1;
    * this will work for parth b
    * Given a string, it will search for anyone with last name equal
    * to given string and return the first occurance of a person
    * with that last name
    public Person search_by_last_name ( final String last_name)
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.last_name.equalsIgnoreCase(last_name))
    return listed_person;
    return null;
    * This method should work for part c
    * Given the month, given in the form of an int, it will return a list
    * of people whose Birthdays are in that month
    public Vector search_by_birth_month (final int birth_month)
    // this is for input checking
    if (birth_month > 12 || birth_month < 1)
    throw new RuntimeException("That is not a month");
    // main stuff
    Vector v1 = new Vector();
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.birthday.birth_month == birth_month)
    v1.add( listed_person);
    return v1;
    * This method should satisfy part d
    * Given a phone number in the form 'xxx-xxx-xxxx', this function will
    * return the person with that number
    public Person search_by_phone_number (final String pnumber)
    if (pnumber.length() != 12
    || ! is_It_A_PhoneNumber(pnumber)
    throw new RuntimeException("This phone number is not of right form (ex. xxx-xxx-xxxx)");
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.phoneNumber.equalsIgnoreCase(pnumber))
    return listed_person;
    return null;
    // this function uses the regex features of java which i am not so sure about....
    private boolean is_It_A_PhoneNumber(final String possPnum)
    boolean return_value = true;
    String[] sa1 = possPnum.split("-");
    if (sa1[0].length() != 3 ||
    sa1[1].length() != 3 ||
    sa1[2].length() != 4 ){ return_value = false;}
    return return_value;
    Thanks to anyone who can help me out

    Code:
    package back_end;
    import java.util.*;
    public class Test_backend
    * @param args
    public static void main(String[] args)
    //Relation_type FRIEND;
    // TODO Auto-generated method stub
    Birthday b1 = new Birthday(9,2,1985);
    Birthday b2 = new Birthday(6,21,1985);
    Birthday b3 = new Birthday(1,2,1990);
    Birthday b4 = new Birthday(1,3,1950);
    Person p1 = new Person ("Sloan", "Mergler", "4 vanderbilt drive",
    "516-551-0829", b1, Relation_type.FRIEND );
    Person p2 = new Person ("Taylor", "Bowne", "21 greywood street",
    "516-944-6812", b2, Relation_type.FRIEND);
    // these are random numbers for birthdays
    Person p3 = new Person ("Daniel", "Py", "21 roger drive apt 2",
    "516-944-7530", b3, Relation_type.FAMILY_MEMBER);
    Person p4 = new Person ("Richard", "Py", "21 roger drive apt 1",
    "516-944-7530", b4, Relation_type.FAMILY_MEMBER);
    Address_book a1 = new Address_book();
    a1.add_to_book(p1);
    a1.add_to_book(p2);
    a1.add_to_book(p3);
    a1.add_to_book(p4);
    System.out.println("This is testing search_by_last_initial");
    Vector vt1a = a1.search_by_last_initial("M");
    Test_backend.printOutVector(vt1a);
    System.out.println("Sloan Mergler should be : ");
    Vector vt1b = a1.search_by_last_initial("P");
    Test_backend.printOutVector(vt1b);
    System.out.println("Daniel Py and Richard Py should be :");
    System.out.println("This is testing search_by_last_Name");
    Person lastname1 = a1.search_by_last_name("Mergler");
    System.out.println(lastname1.first_name + " " + lastname1.last_name +
    " should be Sloan Mergler " );
    Person lastname2 = a1.search_by_last_name("Bowne");
    System.out.println(lastname2.first_name + " " + lastname2.last_name +
    "should be Taylor Bowne" );
    System.out.println("This is testing search_by_birth_month");
    Vector vt3a = a1.search_by_birth_month(1);
    Test_backend.printOutVector(vt3a);
    System.out.println("should be Daniel Py and Richard Py");
    Vector vt3b = a1.search_by_birth_month(6);
    Test_backend.printOutVector(vt3b);
    System.out.println("should be Taylor Bowne");
    System.out.println("This is testing search_by_phone_number");
    Person pt4a = a1.search_by_phone_number("516-944-7530");
    System.out.println(pt4a.first_name + " " + pt4a.last_name +
    " should be Daniel Py");
    Person pt4b = a1.search_by_phone_number("516-551-0829");
    System.out.println(pt4b.first_name + " " + pt4b.last_name +
    " should be Sloan Mergler");
    public static void printOutVector(Vector v1)
    for (int x = 0; x < v1.size(); x++)
    Person p1 = (Person) v1.get(x);
    String s1 = p1.first_name +" " + p1.last_name + "";
    System.out.println(s1);
    return;
    package back_end;
    public enum Relation_type
    FAMILY_MEMBER,
    FRIEND,
    BUSINESS_ASSOCIATE
    package back_end;
    public class Person
    String first_name;
    String last_name;
    String address;
    String phoneNumber;
    Birthday birthday;
    Relation_type relation;
    public Person (String first_name, String last_name, String address, String phoneNumber, Birthday birthday, Relation_type relation)
    this.first_name = first_name;
    this.last_name = last_name;
    this.address = address;
    this.phoneNumber = phoneNumber;
    this.birthday = birthday;
    this.relation = relation;
    // default constructor
    public Person (){}
    package back_end;
    public class Birthday
    int birth_month;
    int birth_day;
    int birth_year;
    Birthday(int birth_month, int birth_day, int birth_year)
    this.birth_month = birth_month;
    this.birth_day = birth_day;
    this.birth_year = birth_year;
    package back_end;
    import java.util.*;
    * This class is the addressbook, it is to keep track of all your associates
    public class Address_book
    int MAX_SIZE = 500;
    public ArrayList book;
    // constructor
    public Address_book()
    this.book = new ArrayList(MAX_SIZE);
    // methods
    public void add_to_book(Person newPerson)
    boolean it_worked = this.book.add(newPerson);
    if (it_worked){ return ;}
    else
    throw new RuntimeException ("Too many items in book, it is filled up");
    * Functionality for this class
    * a) Search for all of the names and phone numbers by first letter of
    * last name (this can be displayed in a message box).
    * b) Search for a particular person by last name, displaying their
    * phone number, address, and date of birth.
    * c) Display the names of people whose birthdays are in a given month.
    * d) Search for a person by phone number, displaying their name,
    * address, and their relationship (ie Family, Friend, or Associate).
    * This method shold work for functionality part a
    * Given a string containing one letter, this function will search through
    * this and try to find all occurances of people whose last name start
    * with the given string and return it in a vector
    public Vector search_by_last_initial (final String last_initial)
    // this is for input error checking
    if (last_initial.length() != 1){
    throw new RuntimeException("Input was not supposed to be that long");
    Vector v1 = new Vector();
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.last_name.startsWith(last_initial))
    v1.add( listed_person);
    return v1;
    * this will work for parth b
    * Given a string, it will search for anyone with last name equal
    * to given string and return the first occurance of a person
    * with that last name
    public Person search_by_last_name ( final String last_name)
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.last_name.equalsIgnoreCase(last_name))
    return listed_person;
    return null;
    * This method should work for part c
    * Given the month, given in the form of an int, it will return a list
    * of people whose Birthdays are in that month
    public Vector search_by_birth_month (final int birth_month)
    // this is for input checking
    if (birth_month > 12 || birth_month < 1)
    throw new RuntimeException("That is not a month");
    // main stuff
    Vector v1 = new Vector();
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.birthday.birth_month == birth_month)
    v1.add( listed_person);
    return v1;
    * This method should satisfy part d
    * Given a phone number in the form 'xxx-xxx-xxxx', this function will
    * return the person with that number
    public Person search_by_phone_number (final String pnumber)
    if (pnumber.length() != 12
    || ! is_It_A_PhoneNumber(pnumber)
    throw new RuntimeException("This phone number is not of right form (ex. xxx-xxx-xxxx)");
    final int current_size = this.book.size();
    for ( int x = 0; x < current_size; x++)
    final Person listed_person = (Person) this.book.get(x);
    if (listed_person.phoneNumber.equalsIgnoreCase(pnumber))
    return listed_person;
    return null;
    // this function uses the regex features of java which i am not so sure about....
    private boolean is_It_A_PhoneNumber(final String possPnum)
    boolean return_value = true;
    String[] sa1 = possPnum.split("-");
    if (sa1[0].length() != 3 ||
    sa1[1].length() != 3 ||
    sa1[2].length() != 4 ){ return_value = false;}
    return return_value;
    }

Maybe you are looking for

  • Tab pages in oracle forms

    hi , I have two different Content Canvases in oracle form 6i and my requirement is such that i need to have these two content canvases in tab canvas pages. can Any one please tell me how i have to join these two content canvases in two tab pages. sin

  • Remove Prefix in RF scanner

    Hi All, Can anyone advise me how to remove the prefix when reading the barcode label? I designed an RF screen with material number with standard field RLMOB-MATNR.  But the labels that we receive is coming with a prefix "P" (part no.) in barcode.  Wh

  • Change musics details on Nokia N8

    i just tried to change music details on my Nokia N8 but its look there's no any option capable to change the music detail on the device.  is this a problem? or it come from its phone and we cant change anything??  Solved! Go to Solution.

  • Cisco ISE - Computer and User Authenticiation on AD for Wireless Clients.

    Hello all, I am trying to configure Cisco ISE to authenticate/authorize Wireless access with PEAP MsChapv2. The AD user authorization works fine, but I cannot see on the logs a challenge for the computer verification (it must be a domain member). I h

  • Entering Source and Target Values in Value Mapping

    Hi, Is there any auomative way of entering source and target values in Value Mapping or FixValues instead of manually entering the values. I have around 400 values to be entered on both sides.....just thinking of an easy way to do it.... Thanks for s