Using ClipboardData Class

Could anyone
propose an example of using ClipboardData Class
to read and write data to the clipboard?
For example paste in the Clipboard an image with a
tooltip and a hyperlink
thank you very much

Thank You,
Obviously I'm not trying to paste Clipboard's objects
in Notepad. The goal is to paste them
in to a Word or
PowerPoint
document.
Get and Set an image from the Clipboard
is very simple, but it is probably necessary to use metadatata for associate the image with
a
tooltip and a hyperlink.
My question is related to the clipboardData
Class. Perhaps this could be done
using the Data and
Metadata properties.

Similar Messages

  • Using List Class in java.awt / java.util ?

    have a program that:
    import java.util.*;
    List list = new LinkedList();
    list = new ArrayList();
    ... read a file and add elements to array
    use a static setter
    StaticGettersSetters.setArray(list);
    next program:
    import java.awt.*;
    public static java.util.List queryArray =
    StaticGettersSetters.getArray();
    If I don't define queryArray with the package and class, the compiler
    gives an error that the List class in java.awt is invalid for queryArray.
    If I import the util package, import java.util.*; , the compiler
    gives an error that the list class is ambiguous.
    Question:
    If you using a class that exists in multiple packages, is the above declaration of queryArray the only way to declare it ?
    Just curious...
    Thanks for your help,
    YAM-SSM

    So what you have to do is explicitly tell the compiler which one you really want by spelling out the fully-resolved class name:
    import java.awt.*;
    import java.sql.*;
    import java.util.*;
    public class ClashTest
        public static void main(String [] args)
            java.util.Date today    = new java.util.Date();
            java.util.List argsList = Arrays.asList(args);
            System.out.println(today);
            System.out.println(argsList);
    }No problems here. - MOD

  • Creating a triangle using polygon class problem, URGENT??

    Hi i am creating a triangle using polygon class which will eventually be used in a game where by a user clicks on the screen and triangles appear.
    class MainWindow extends Frame
         private Polygon[] m_polyTriangleArr;
                       MainWindow()
                              m_nTrianglesToDraw = 0;
             m_nTrianglesDrawn = 0;
                             m_polyTriangleArr = new Polygon[15];
                             addMouseListener(new MouseCatcher() );
            setVisible(true);
                         class MouseCatcher extends MouseAdapter
                             public void mousePressed(MouseEvent evt)
                  Point ptMouse = new Point();
                  ptMouse = evt.getPoint();
                if(m_nTrianglesDrawn < m_nTrianglesToDraw)
                                int npoints = 3;
                        m_polyTriangleArr[m_nTrianglesDrawn]
                      = new Polygon( ptMouse[].x, ptMouse[].y, npoints);
    }When i compile my code i get the following error message:
    Class Expected
    ')' expectedThe two error messages are refering to the section new Polygon(....)
    line. Please help

    Cannot find symbol constructor Polygon(int, int, int)
    Can some one tell me where this needs to go and what i should generally
    look like pleaseI don't think it is a good idea to try and add the constructor that the compiler
    can't find. Instead you should use the constructor that already exists
    in the Polygon class: ie the one that looks like Polygon(int[], int[], int).
    But this requires you to pass two int arrays and not two ints as you
    are doing at the moment. As you have seen, evt.getPoint() only supplies
    you with a single pair of ints: the x- and y-coordinates of where the mouse
    button was pressed.
    And this is the root of the problem. To draw a triangle you need three
    points. From these three points you can build up two arrays: one containing
    the x-coordinates and one containing the y-coordinates. It is these two
    arrays that will be used as the first two arguments to the Polygon constructor.
    So your task is to figure out how you can respond to mouse presses
    correctly, and only try and add a new triangle when you have all three of its
    vertices.
    [Edit] This assumes that you expect the user to specify all three vertices of the
    triangle. If this isn't the case, say what you do expect.

  • Uploading bitmapData using FileReference class ?

    Hi gurus ;)
    Question nr 1.
    Is it possibly to upload bitmapData to server using
    FileReference class ? How should i approach this issue, is there
    any ready classes available for this purpose. I'm generating
    bitmaps inside my Flash/Flex App and need to store them under users
    profile in server.
    Question nr 2.
    Can i upload files from remote server to another using
    FileReference class
    e.g Somehow like :
    uploadURL = new URLRequest();
    uploadURL.url = "
    http://www.[yourDomain
    fileURL.url = "
    http://www.myLocation.com/myfile.JPG";
    file = new FileReference(fileURL.url);
    file.upload(uploadURL);
    This is just an idea, sure not working ;)
    Any ideas are helpful
    Thx
    iquaaani

    I did a small application that uploads a file to the server
    every hour. If the server response that a login is required to
    upload the file, it goes to a login page to do the login and
    retried to upload the file.
    I got the server response in order to know if the file did
    upload correctly or not (I have to send more form data than just
    the file). I didn't try the mime type since it's not relevant for
    my application and usualy this information is not very trust worthy
    anyways.
    I'm not sure what you mean with exceptions, if you are
    referring to HTTP errors, I think there is an event for that, but I
    used the IOError event for this, and it seems to work good
    also.

  • Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

  • Problem with constructors and using public classes

    Hi, I'm totally new to Java and I'm having a lot of problems with my program :(
    I have to create constructor which creates bool's array of adequate size to create a sieve of Eratosthenes (for 2 ->n).
    Then it has to create public method boolean prime(m) which returs true if the given number is prime and false if it's not prime.
    And then I have to create class with main function which chooses from the given arguments the maximum and creates for it the sieve
    (using the class which was created before) and returns if the arguments are prime or not.
    This is what I've written but of course it's messy and it doesn't work. Can anyone help with that?
    //part with a constructor
    public class ESieve {
      ESieve(int n) {
    boolean[] isPrime = new boolean[n+1];
    for (int i=2; i<=n; i++)
    isPrime=true;
    for(int i=2;i*i<n;i++){
    if(isPrime[i]){
    for(int j=i;i*j<=n;j++){
    isPrime[i*j]=false;}}}
    public static boolean Prime(int m)
    for(int i=0; i<=m; i++)
    if (isPrime[i]<2) return false;
    try
    m=Integer.parseInt(args[i]);
    catch (NumberFormatException ex)
    System.out.println(args[i] + " is not an integer");
    continue;
    if (isPrime[i]=true)
    System.out.println (isPrime[i] + " is prime");
    else
    System.out.println (isPrime[i] + " is not prime");
    //main
    public class ESieveTest{
    public static void main (String args[])
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    new ESieve(maximum);
    for(int i=0; i<args.length; i++)
    Prime(i);}

    I've made changes and now my code looks like this:
    public class ESieve {
      ESieve(int n) {
       sieve(n);
    public static boolean sieve(int n)
         boolean[] s = new boolean[n+1];
         for (int i=2; i<=n; i++)
    s=true;
    for(int i=2;i*i<n;i++){
    if(s[i]){
    for(int j=i;i*j<=n;j++){
    s[i*j]=false;}}}
    return s[n];}
    public static boolean prime(int m)
    if (m<2) return false;
    boolean x = sieve(m);
    if (x=true)
    System.out.println (m + " is prime");
    else
    System.out.println (m + " is not prime");
    return x;}
    //main
    public class ESieveTest{
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    public static void main (String[] args)
    int n; int i, j;
    for(i=0;i<=args.length;i++)
    n=Integer.parseInt(args[i]);
    int maximum=max(args[]);
    ESieve S = new ESieve(maximum);
    for(i=0; i<args.length; i++)
    S.prime(i);}
    It shows an error for main:
    {quote} ESieveTest.java:21: '.class' expected
    int maximum=max(args[]); {quote}
    Any suggestions how to fix it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • End of Page event in ALV report using SALV class[cl_salv_hierseq_table]

    Hi ,
    have been working on a ALV report using the class SALV cl_salv_hierseq_table
    I am facing few issues pertaining to two things:
    1. Displaying some subtotal text along with the subtotals.
    Example refer the standard demo example: SALV_DEMO_HIERSEQ_FORM_EVENTS
    Now instead of A 17 and A26 I would like to show text like Subtotal for the Carrid.for subtotals and grand totals
    Like   Subtotal for A 17 is :      XXXXXXX
              GrandTotal is         :      YYYYYY
    2. We have a page break and a new page for every purchasing group as in the standard example SALV_DEMO_HIERSEQ_FORM_EVENTS for CARRID.
    I need to display some variable values as number of documents ,total number of records etc at the end of each CARRID group before a new page starts for the next CARRID.Please note i do not want it on every page.it should only be diaplyed at the end of page whose next page would be for next CARRID.[basically at end of every carrid]Example:after displaying all details for AA need to display the number of records for that carrid at the end of the page[as page break is based on CARRID]/
    Thanks
    Jyotsna

    at end of page event, for CL_SALV_EVENTS_HIERSEQ, has some useful parameters allowing to know where you are at the time of event
    parameter VALUE is of type CL_SALV_FORM which contains public attribute IF_SALV_FORM~ACCDESCRIPTION; you can slo get contents of it
    about text of total/subtotal, this is normally set in the layout

  • Use of classes Vs tables

    Hi All,
    I have e requirement where i need to select data from tables....... It was told to me that i can make use of classes instead of tables...... I am working on Inbound delivery in EWMmodule.......
    can any one through some light on this....... how can i make use of classes to get data from sap tables.........
    Regards,
    Poonam

    Hi Faisal,
    Just to correct you it's "Methods of Global Persistent Classes".
    Not to hide my ignorance in OOPs, but i don't think persistent classes should be used for mundane selects. It's much easier to write, maintain & troubleshoot a select construct than a persistent class
    You can go through this discussion on: Why do we need Persistent Classes ?
    BR,
    Suhas

  • Help using scanner class to count chars in file

    Hi all, I am learning Java right now and ran into a problem. I need to use the Scanner class to accurately count the number of chars in a file including the line feed chars 10&13.
    This what I have and it currently reports a 201 byte file as having 194 chars:
         File file = new File(plainFile);
         Scanner inputFile = new Scanner(file);
         numberOfChars = 0;
         String line;
         //count characters in file
         while (inputFile.hasNextLine())
              line = inputFile.nextLine();
              numberOfChars += line.length();
    I know there are other ways using BufferedReader, etc but I have to use Scanner class to do this.
    Thanks in advance!

    raichle wrote:
    Wow guys, thanks for the help! I've got a RTFMWell, what's wrong to have a look at the API docs for the Scanner class?
    and directions that go against the specs I said.Is that so strange to suggest a better option? What if I ask a carpenter "how do I build a table with a my stapler?". Should I give the man an attitude if he tells me I'd better use a saw and hammer?
    I'm also aware that it "eats" those chars and obviously looking for a way around that.
    I've looked through the java docs, but as I said, I'm new to this and they're difficult to understand. The class I am auditing req's that this be done using Scanner, but I don't see why you demand an explanation.
    Can anybody give me some constructive help?Get lost?

  • Customizing FD01 and FB70 using PS Class and Characteristics

    Hello SAP Experts
    I have the following issue:
    My client has a requirement where we need to customize the Customer Master  (FD01) screen and the Invoice Posting Screen (FB70). A few additional fields have to be added by creating a separate tab. I was intending to take Abaper's help and do this using user exits but I have been suggested by the cleint to use SAP PS Class and Characteristics feature to do this. Can someone please throw some light on this feature and how can i create custom fields on FD01 and FB70 screens. Is there a way we could customize these screens using PS class and characteristics. Your opinions would be much appreciated.
    Please kindly give your suggestions. Thanks in advance
    Regards,
    Nik

    Joao Paulo,
    Thank you for the response. I have tried to obtain some info from OSS but no luck. Tried all means but there is limited information available.
    Nik

  • How to use aggregation -Average using a class

    Hi Gurus,
       In my report i have used cl_salv_table  and for event i have used cl_salv_events_table, now i want to calculate average for some of the fields as such subtotal calculation . In my normal alv reports i have used the class lcl_event_receiver also, but for the report which iam using a class , i d'not know how to compain both the class  (i.e) cl_salv_table, class lcl_event_receiver. Help me to solve the problem.

    cancelled

  • Using a class or servlet that implements Serializable

    Hello everyone,
    Can someone please help me. I need to make a program that uses a class or servlet that implements Serializable and then use the values of the variables in servlets.
    The first is using it to validate login. then changing the color of the background, header and footer of each servlet.
    the variables in the Serialized file are all Strings for color, username, password, header text and footer text.
    I tried using the applet tag to run the class in the servlet but it is not working.

    It's not working because you seem to be making random guesses what servlets, serialization and files are

  • How to use application class reference in the controller methods of BSP

    Hi,
    I have created a bsp application and also created an application class and assigned it to the application class. In the application class, I have created attribute TEXT type string(public and instance parameter).
    In the controller let's say main.do, I am trying to give a value to to the text by adding the following code.
    application->text = 'test'.
    I am getting syntax error saying field 'text' is unknown. It is not contained in one of the specified tables nor defined by DATA statement. 
    Please can someone let me know how to use the application class in the coding with an example. I couldn't find how exactly this has to be reference. Please help.
    Best regards
    Siva

    Hi,
    if you are having main controller and sub-controller then you may need to use below coding to use application class reference.
    *Data declaration
      DATA:  obj_cntrl        TYPE REF TO cl_bsp_controller2,
             obj_sub_cntrl   TYPE REF TO z_cl_sub_cntl,
             application TYPE REF TO z_cl_application.
    *Get the controller
      CALL METHOD obj_main_cntrl->get_controller   "obj_main_cntrl is the object of main controller
        EXPORTING
          controller_id       = 'SUB'   "Controller ID
        RECEIVING
          controller_instance = obj_cntrl  .
      obj_sub_cntrl ?= obj_cntrl  .
      application ?= obj_sub_cntrl ->application.
    or simply use below code in your controller method.
      application ?= me->application.
    Thnaks,
    Chandra

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • Needs help.....Please about using different classes

    I don't know how to use differenet classes.
    Please tell me how to write class to suit Start. This stuff me up. Please .... help me
    <<My program>>
    //Start
    public class Start
    {  private Artist[] Artists;
    private Record[] records;
    private Person[] Manager;
    private TextMenu makeMenu = new TextMenu();
    public static void main(String[] args)
         Start studio = new Start();
    studio.menu();
    public Start()
    {  //Person.Manager(ManagerName,HouseNumber,StreetNumber,PhoneNumber)
         Manager = new Person[1];
         Manager[0] = new Person("Yangfan",88,"Young ST",11118888);
         //Artist(GroupID,ArtistName,HouseNumber,StreetNumber,PhoneNumber)
         Artists = new Artist[5];
    Artists[0] = new Artist(1,"Backstreet Boys",58,"Music ST",99998888);
    Artists[1] = new Artist(2,"Santana",68,"Music ST",99998899);
    Artists[2] = new Artist(3,"Macy Gray",78,"Music ST",55558888);
    Artists[3] = new Artist(4,"Ricky Martin",88,"Music AVE",77778888);
    Artists[4] = new Artist(5,"Did Rock",55,"Music Road",66667777);
    //Record(RecordingID,RecordName,Artist,StartTime,FinishTime,RecordingDate,GuestArtist1,GuestArtist2)
    records = new Record[6];
    records[0] = new Record(1,"I want it that way",Artists[0],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[1] = new Record(2,"Smooth",Artists[1],11,12,"05/08/2001",Artists[1],"");
    records[2] = new Record(3,"Do something",Artists[2],11,"05/08/2001",Artists[3],"");
    records[3] = new Record(4,"Livin La Vida Loca",Artists[3],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[4] = new Record(5,"Bawitdaba",Artists[4],11,13,"05/08/2001",Artists[1],"");
    records[5] = new Record(6,"The one",Artists[0],11,14,"05/08/2001",Artists[1],"");
    public void menu()
    {  String[] choices = {">>>List Manager Details",">>>List All Artist Names",">>>List An Artist Telephone-Number",">>>Show Details For One Recording",">>>Add A New Recording",">>>List The Recording Costs For All Artists",">>>List Artist's Reocording",">>>Exit Program"};
    while (true)
    {  switch (makeMenu.getChoice(choices))
    {  case 1: showAllArtists();
    break;
    case 2: showAllRecords();
    break;
    case 3: System.exit(0);
    break;
    case 4: System.exit(0);
    break;
    case 5: System.exit(0);
    break;
    case 6: System.exit(0);
    break;
    case 7: System.exit(0);
    break;
    case 8: System.exit(0);
    break;
    default:
    public void showAllArtists()
    {  int numArtists = Artists.length;
    for(int i = 0; i < numArtists; i++)
    {  Artists[i].displayArtistDetails();
    public void showAllRecords()
    {  for (int i = 0; i < records.length; i++)
    {  System.out.println();
    records.printRecordDetails();
    <<Assignment>>
    Due - midnight, Wednesday August 22nd
    This assignment will test your knowledge of Java programming using classes, encapsulation and javadoc.
    The base requirements
    Write a complete Java class to manage a Digital Recording Studio. The studio wants to keep a list of all Artists that use the studio and also wishes to keep track of all Recordings that have been made. An important function of the program is to calculate the time spent making a recording and charge the Artist for the time used.
    You must create at least the following classes, Start, Studio, Person, Artist, Recording, Address. You may create other classes if needed as well
    Start will contain main(), create one instance of a Studio and execute a Menu of commands to test your code. Studio should contain a studio name, an array of Artist and an array of Recording plus the studio manager (a Person). Each Artist should contain the name of the group and an Address. Each Person will have a name and a home address. Each recording will have a Title (usually song title), an Artist (only one), and a list of guestArtist (they are Artist�s but will not receive royalties) the number of the CD the recording is stored on (numbers are numerical and recordings are saved on CD-R), plus the recording start and finish times for the recording session (suggest you use Java Date class � refer to the API). An Address will contain, house number (integers only), a street name and a telephone number. There is no need to store city and country.
    To enter a set of data for testing your program � main() should call a method in the Start class that will fill in a set of values by creating objects and filling in values by calling methods in each class. This is the ONLY method allowed to be longer than 1 page long � normally we would read the data from a file but there are no O-O principles that can be learnt with simply filling in data values. It is suggested to create say at least 4 Artist�s and 6 Recordings (at least one with 1 guest Artist and one with 2 guestArtist�s)
    A menu for testing your program should be provided (it is suggested to put the Menu into a separate class as you need at least 3 menus). While other commands are possible, only the following ones will receive marks.
    Menu commands needed are
    List the Managers name, address and telephone number
    List all Artist Names
    List an Artist telephone number (a sub menu showing valid Artist�s is required)
    Show all details for one Recording ( sub menu of valid Recordings will be needed and remember there can be more than one guestArtist)
    Add a new Recording, user will need to be prompted for all details.
    List the recording costs for all Artists � show each Artist on a separate line with their name and total amount, charge for using the studio is $1000 per hour or part thereof, example for a 1 hour and 10 minute recording the Artist will be billed for 2 hours.
    List all the Recording�s one Artist has worked on (sub menu of Artists needed), the list should show whether they were the Artist or a guestArtist
    Exit program
    Use fixed sizes for arrays, suggest 20 is suitable for all arrays. Java can handle dynamic data structures (where the number of elements can grow or shrink), but that is beyond a first assignment.
    Do NOT make ANY methods static - this defeats the Object Oriented approach and will result in ZERO marks for the entire assignment.
    Data MUST be encapsulated, this means that all the data relating to an object are to be stored INSIDE an object. None of the data detail is to be globally available within your program - hence do not store Artist names in either Studio or Recordings � just store a reference instead. Do NOT create ID numbers for Artists, you should use References instead � for many students this will be the hardest part as you have to use Objects, not program in a C style to solve the problem. Note that if there are any non-private data in classes then zero will given for marks for encapsulation.
    Good programming style is expected (see web page or lecture notes). In particular, you must use javadoc to generate a set of html pages for your classes. Make sure you use the special javadoc style comments in your source code. Marks will be granted for both using javadoc and also for including sensible javadoc comments on each class and each public method.
    What to Hand In
    Read the turnin page, basically the .java files, a readme.txt to tell the marker which file the program starts from plus the javadoc (html) files. Do NOT send .class files (if you do send these we will delete them and recompile your program), do NOT compress with gtar, tar, zip or use any other tool on your files. Turnin automatically compresses all your files into a single archive for us to mark.
    The simplest way to turnin all your files is to place all files in one directory then just use the *.* wildcard to turn in all files within that one directory.
    You must turnin all files that are not part of Java 1.3. In particular, you are allowed (actually encouraged) to use EasyIn or SavitchIn but should include the one you use in the files you submit. It is STRONGLY suggested that you copy all the files into another directory, test it works there by compiling and executing then turnin files from that directory. A common problem is students adding comments at the last minute then not testing if it still compiles. The assignment will be marked as submitted � no asking later for leniency because you added comments at the last minute and failed to check if it still worked.
    If the tutors are unable to compile your submission, they will mark the source code but you will lose all the execution marks. Sorry, but it is your responsibility to test then hand in all files.
    Comments
    For CS807 students, this program should be fairly easy if it was to be programmed in C (you would use several struct). The real art here is to change over to programming objects. Data is contained in an object and is not global. This idea is essential to using Java effectively and is termed encapsulation. Instead of using function(data), you use objectName.method( ). Effectively you switch the data and functions around, the data has a method (function) attached to it, not the other way around as in C (where you have a function and send data to it).
    While there will be some marks for execution, the majority of the marks will be given for how well you write your code (including comments and documentation) and for how well you used O-O principles. Programs written in a C style with most of the code in one class or using static will receive ZERO marks regardless of how well they work.
    You are responsible for checking your turnin by reading the messages turnin responds with. Failure to read these messages will not be an acceptable excuse for submitting an incorrect assignment. About 2% of assignments sent to turnin are unreadable (usually empty) and obtain 0.
    Late submissions
    Late submissions will only be accepted with valid reasons for being late. All requests for assignment extensions must be made via email to the lecturer. Replies for acceptance or refusal will made by email. Instant replies are unrealistic (there is usually a flood of queries into my mail box around assignment due dates) and the best advice is to ask at least 4 days in advance so that you will have a reasonable chance of getting a timely reply and allow yourself enough time to submit something on time if the extension is not granted.
    ALL late submissions will be marked LAST and will NOT be sent to tutors for marking until all other assignments have been marked. As an example, if you submit late and your assignment is not yet marked by the time assignment 2 is due then it will be pushed to the end of the marking pile as the assignments that were submitted on time for assignment 2 will take priority.
    If you make a second submission after the submission date, only the first submission will be marked. We will not mark assignments twice! You can update your submission BEFORE the submission date if you need to - this will just overwrite the first submission. The latest time for a late submission is 5pm on the Wednesday after the due date. This is because, either a solution will be handed out at that lecture or details of the assignment will be discussed at the lecture. I cannot accept any assignment submissions after that time for any reason at all including medical or other valid reasons. For those who are given permission to be later than the maximum submission time � a different assignment will be handed out. Remember, if you decide to submit late you are VERY UNLIKELY to receive feedback on your assignments during semester.
    Assignments will be removed from turnin and archived elsewhere then forwarded to tutors for marking on the morning after the assignment is due. A different tutor will mark each of your assignments � do not expect the tutor you see at the tutorials to be your marker.
    Marks will be returned via email to your computer science yallara account � ideally within 2 weeks. I will send marks out when I receive them so do not send email asking where your marks are just because a friend has theirs. If you want your email forwarded to an external account, then place a valid .forward file into your yallara account. The Help Desk on level 10 can assist you in setting this up if you do not know how to do it.

    I have seen other people who have blatantly asked for
    other people to do their homework for them, but you
    are the first person I've seen to actually cut and
    paste the entire assignment as it was handed to you.
    Amazing.
    Well, unlike some of the people you're talking about, it seems like zyangfan did at least take a stab at it himself, and does have a question that is somewhat more sepcific that "please do this homework for me."
    Zyangfan,
    marendoj is right, though. Posting the entire assignment is kind of tacky. If you want to post some of it to show us what you're trying to do, please trim it down to the essential points. We don't need to see all the instructor's policies and such.
    Anyway, let me see if I understand what you're asking. You said that you know how to write the code, but only by putting it all in one class, is that right? What part about using separate classes do you not understand? Do you not know how to make code in one class aware that the other class exists? Do you not know how code in class A can call a method in class B?
    Please be a bit more specifice about what you don't understand. And at least try using multiple classes, then when you can't figure out why something doesn't work, explain what you did, and what you think should have happened, and what did happen instead.
    To get you started on the basics (and this should have been covered in your course), you write the code for two classes just like for one class. That is, for class A, you create a file A.java and compile it to A.class. For class B, you create a file B.java and compile it to B.class. Given how rudimentary you question is, we'll skip packages for now. Just put all your class files in the same directory, and don't declare packages in the .java files.
    To call a method in class B from code that's in class A, you'll need an object of class B. You instantiate a B, and then call its methods.
    public class B {
      int count;
      public B() { // constructor
      public void increment() {
        count++;
    public class A {
      public static void main(String args[]) {
        B b = new B();
        b.increment();
    }Is this what you were asking?

Maybe you are looking for

  • Why is my ipod touch saying "backup corrupt or not compatible" error message?

    My iPod touch has been fine for years and I only really add new music sporadically. Now I am getting an error message saying that it cannot back up my iPod because it is corrupt or not compatible with the iPod. I have already done a factory reset and

  • Updating Flash player causes computer to forget folder views

    Every time I update the Flash player my computer forgets all my folder view settings.  The icons in all my folders aren't in the position that I put them and Windows refuses to remember any further changes to position or type of view (Tiles/Details/e

  • Problem calling C# dll using JNI

    Hi, I'm trying to call C# functions from a JNI interface. I built a C++ DLL to link the Java and C# calls together, but I am always getting the same error. Calling the C# DLL directly from the C++ code (compiled as an application) does not cause this

  • Use These Settings by Default - doesn't work

    When I am monitoring Active JMS Destinations - you can go into the Customize and add columns. On that customize screen there is a check box for "Use These Settings by Default". Which I took to mean I could change the data displayed and it would be re

  • How to restore lost bookmarks on iPad after iOS update

    I lost a few bookmarks after updating to iOS 7. How could  I restore the lost ones?