Can you print the contents of an array?

I am building a chat program and what to be able to show who is online, i simply want to display the contents of the name array to the text area as this is how i send and recieve the usernames.
I thought the names array may contain all the names and therefore can be printed to the textarea.
is this possible and what command do i use if so?
thank you

To print part of the list (assuming they are in the
first slots, and all nulls are at the end):
System.out.println(Arrays.asList(arrayOfStrings)
.subList(0, numberOfNames));
many thanks, this has helped alot!
the only problem i am now facing is that i have done it via RMI and every time i send a message the person who sends the message becomes added to the list again, for example i end up with a long list like:
online = sun, sun, sun, sun, sun
when there is only one sun! this list increases every time a message is sent!
i only want the name there once!
and also on the first sending there is no value in the array, starts off [ ] when sun is online.
thanks

Similar Messages

  • Can you print the contents of a blob in Bi Publisher

    For example, Bi Publisher generate a pdf file in apex that will print the contents of a blob.
    Let's say you have a record with test.xls in a blob, can I take the test.xls out of the record and have bi publisher print it.
    Thanks,
    Doug

    BI Publisher can add some blobs to a report, such as a .jpg / .gif / .png, but excel just doesn't make sense, nor do I think it would work.
    Tyler Muth
    http://tylermuth.wordpress.com
    "Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book

  • Can you print the "theme" you used to make the dvd onto the dvd?

    I used the roadtrip theme.  I want to print directly on to the dvd, and I want to use the same roadtrip theme.  can you do this?  how?  if possible.

    Is this the background you're looking for?
    It's located in the HD/Library/Application Support/iDVD/Themes/iDVD 6/Road Trip-Main.theme/Contents/Resources folder.  Or you can just drag the background image from this post to your Desktop.
    If you want to have the images you added to the dropzones included then take a screenshot of the iDVD window as Klaus1 suggested.  That will give you a 72 dpi image like this:
    with the dropzones filled of course.
    OT

  • How can you access the content behind an Animate .oam file in Muse?

    I have an animation to open doors at the bottom of a parallax scroll, but once the doors open, I cannot click on any of the buttons in my "room" that were set up in Muse. Anyone have any ideas of how to fix this? I am using CC for both programs.
    par·al·lax: The effect whereby the position or direction of an object appears to differ when viewed from different positions, e.g., through the viewfinder and the lens of a camera
    More »

    Hello,
    In case .oam file is placed above the content, then I am afraid user would not be able to click on the content which is behind the animation.
    There are two workarounds that you have. Either have the content (Buttons behind the open door) placed inside the Animation itself so that users can click on it.
    Or you can have transparent Rectangles (boxes) placed in front of the animation and apply links to them. it should appear like the buttons behind the animation are clickable however it should be these transparent Boxes which would be clickable and are placed above the Buttons and the animation (on the top layer).
    Hope this helps.
    Regards,
    Sachin

  • I have a PDF that it was send to me and I can not print the content

    I have a PDF file send to me to fill the blank , now that I did finish on my print it does not show the content I did typed?

    Is this a form? If so, are you filling it out using Mac Preview? If so, fill out the form using Adobe Reader instead.

  • Can not print the contents of an E-Mail message

    I'm running both Firefox and Nightly and it happens with both but not with IE. My E-Mail is SMTE. If I go to print or print preview of my E-Mail message, there is nothing there but I can cut and paste the text out of the message into Word and then I can print it. I suspect. Double checking, I can not print anything from the browser

    To print part of the list (assuming they are in the
    first slots, and all nulls are at the end):
    System.out.println(Arrays.asList(arrayOfStrings)
    .subList(0, numberOfNames));
    many thanks, this has helped alot!
    the only problem i am now facing is that i have done it via RMI and every time i send a message the person who sends the message becomes added to the list again, for example i end up with a long list like:
    online = sun, sun, sun, sun, sun
    when there is only one sun! this list increases every time a message is sent!
    i only want the name there once!
    and also on the first sending there is no value in the array, starts off [ ] when sun is online.
    thanks

  • Can you copy the contents of an iPod onto a new PC?

    A friend of mine has an iPod and is considering buying a new PC. Because of circumstances he cannot get his library from his old PC. Is it possible for him to copy the contents of his iPod onto new PC to create a new library?

    David,
    These links will give you several methods of recovering whatever songs remain on your iPod; some free, some third-party software, some more comprehensive for restoring Playlists, Ratings, Play Counts, etc. Read them and their associated links before deciding on a strategy that works for you. There are many various third-party software programs that will offer a more robust process, or an easier GUI. Do a Google search for them if the links below leave you wanting…
    Don King Resurrected: Deleted files from hard drive (free user steps – music recovery only)
    MacMuse: Computer Crashed (free user steps – music recovery only)
    Copying music from iPod to computer (a primer on various methods and software)
    Copying Songs from Your iPod to a Mac or PC (resource for 3rd party software)
    iPodRip Software
    PodUtil Software
    Senuti (Mac OS X v10.3 or higher Recovery Utility)
    XPlay (Software For Music Recovery &/or Cross-Platform Functionality)
    XPlay Photo Browser (For recovering Photos)
    After recovering your song files, strongly consider developing a thorough backup strategy for just this type of situation.
    You need at least three sets of your music:
    -- One full set on the PC within iTunes (on internal HD or ExHD)
    -- One full set on an separate external backup medium (CD/DVD/ExHD/other)
    -- One (full or partial) set on the iPod
    Music files on just the iPod and the computer is not considered having any backup. If you cannot store your complete music files on the computer, then create and maintain two external sets.
    Backup both the music files and the Library database file (iTunes Library.itl). What are the iTunes Library files?
    Here is a post on developing a thorough backup strategy: http://discussions.apple.com/click.jspa?searchID=394618&messageID=1263275

  • Can you delete the contents of the Updates folder?

    Hi,
    Trying to free up some space on my hard drive. Using OmniDiskDweeper app. Just wondering if it's safe to delete the contents of the Updates folder; the one located in the hard drive/library. There is about 5 GB of stuff in there.
    thanks,
    J

    Jaymo, I deleted the contents of my "Updates" folder on my MBPro2.2 without any ill-effects.

  • How can you update the content of a textfield in a dynamic xml form from MSAccess and VBA

    I am trying to use the code below to update a field in a dynamic xml form created by Livecycle.
    I can read the field content but cannot change it.
    What am I missing?
    Thanks
    R
    Sub test()
    Dim oPDF As AcroPDDoc
    Dim FileDestName As String
    Dim jso As Object
    Dim ofld As Object
        FileSrcName = "C:\Documents and Settings\My Documents\ADOBE Forms\NoVB.pdf"
        Set oPDF = CreateObject("AcroExch.PDDoc")
        Set jso = oPDF.GetJSObject
        Set ofld = jso.getfield("form1.TopForm.Header.Subform1.Contact")
        Debug.Print ofld.Value
         ofld.Value = "HHH"
        Debug.Print ofld.Value
    oPDF.Save PSsavefull, FileSrcName
    oPDF.Close
    Set jso = Nothing
    Set oPDF = Nothing
    End Sub

    You need to research the difference between an AcroForm and an XFA form.  You're trying to access a "Field" object, which is an AcroForm object.  An XFA form does not have fields, it has nodes.  The JavaScript you are using is specific to AcroForms and you are working with an XFA form.

  • How can I put the contents of an array into a set of write local variable clusters?

    I have a set of controls that a user fills in. The controls are clustered by rows, then combined into a 1D array, then written to a file. When I read the file, I want to feed the array back into the clusters with write local variables. Is there a simple way to handle the numerous local variable clusters so I can stuff the array back into them?
    Is there a better way to handle the whole issue of storing and recovering the information?
    The rows are steps in a procedure, and each row (cluster) contains numerical as well as string controls.

    There are many ways of doing this
    You may convert all your data to strings and save as an ascii file (you have to pay attention to the file format, so you can read it properly.
    Or you can use the configuration vi's, it may work in your case.
    or you may use an invoke node to get all controls of the vi's, save it, then read it, without worrying about any format. I have attached a vi that uses this method.
    Attachments:
    Temp.vi ‏52 KB

  • Can you get the contents of a directory?

    Is there anything in flash that will allow reading of a
    directory structure, so for example a bunch of .jpgs/.swfs are
    sitting in a directory it will read these in and display them
    through the flashplayer?
    I'm currently using XML to do the job but it has been asked
    of me to work without the XML so no editing is required!
    cheers

    Thanks Rabid,
    Not really what I wanted to hear but suspected it wasn't
    possible due to security issues etc... Shame that some simple
    functionality can't be trusted!!!
    Might look into this coldFusion but it's certainly not a
    priority :o)
    cheers

  • Can you access the contents of an imported PDF from a script?

    I need to determine if certain text exists (and it's location on the pdf page) on a PDF that I've imported into ID.
    I know how to do it outside of ID -- but I'd rather do in a JS script.
    Thanks
    Akiva

    David,
    These links will give you several methods of recovering whatever songs remain on your iPod; some free, some third-party software, some more comprehensive for restoring Playlists, Ratings, Play Counts, etc. Read them and their associated links before deciding on a strategy that works for you. There are many various third-party software programs that will offer a more robust process, or an easier GUI. Do a Google search for them if the links below leave you wanting…
    Don King Resurrected: Deleted files from hard drive (free user steps – music recovery only)
    MacMuse: Computer Crashed (free user steps – music recovery only)
    Copying music from iPod to computer (a primer on various methods and software)
    Copying Songs from Your iPod to a Mac or PC (resource for 3rd party software)
    iPodRip Software
    PodUtil Software
    Senuti (Mac OS X v10.3 or higher Recovery Utility)
    XPlay (Software For Music Recovery &/or Cross-Platform Functionality)
    XPlay Photo Browser (For recovering Photos)
    After recovering your song files, strongly consider developing a thorough backup strategy for just this type of situation.
    You need at least three sets of your music:
    -- One full set on the PC within iTunes (on internal HD or ExHD)
    -- One full set on an separate external backup medium (CD/DVD/ExHD/other)
    -- One (full or partial) set on the iPod
    Music files on just the iPod and the computer is not considered having any backup. If you cannot store your complete music files on the computer, then create and maintain two external sets.
    Backup both the music files and the Library database file (iTunes Library.itl). What are the iTunes Library files?
    Here is a post on developing a thorough backup strategy: http://discussions.apple.com/click.jspa?searchID=394618&messageID=1263275

  • Java arrays - can you name the keys?

    i have 1 function that declares 2 ArrayLists of type String. They are the same size and the values are related. Let's call them A & B.
    I was hoping i could have my function return just 1 array, with the values of arraylist A being they keys of the returned array, and the values of arraylist B being the values in the returned array.
    But can you name the elements of an array in java? in php you can, but in java, the only examples i have seen only use the standard #'s: 0, 1, 2, 3, etc. if you can, please post sample syntax.
    i guess i could use a double scripted array, but... well i don't exactly know what the sytax would be for that in declaring the funciton.
    if someone has a link of these kinds of examples / topics they could send me - that would be great too - i googled it but haven't really come across any.
    thanks in advance

    It appears as though what you are trying to do is associate a specific "key" value with another value. For example, let's say you want the word "dog" to be the key for the arraylist value of "bull dog."
    The perfect data structure for this that Java provides is called a Map. Here is some sample code.
    //create something called a HashMap where the first
    //value is the key, and the second value is the value
    //that the key is associated with
    HashMap<String, String> map = new HashMap<String, String>();
    //now, consider the previous example...
    //here is the syntax for storing those values
    map.put("dog", "bull dog");
    //and this would be the syntax for getting a value
    String value = map.get('dog");
    //which would give "bull dog"
    {code}
    Hope that helps :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to print the content of LinkedList int[] and LinkedList LinkedList ?

    Hi guys, its been a long time since i posted here, and now im coming back to programming using java. My problem is, how can i print the content of the list?
    Example:
    LinkedList<int[]> list = new LinkedList<int[]>;
    int[] input = {1,2,3,4,5};
    int[] input2 = {2,32,43,54,65};
    list.add(input);
    list.add(input2);
    how can i print all the content of the linkedlist?
    Please help me..I know its a dumb question but i really dunno how.
    here is the code:
    import java.util.LinkedList;
    import java.util.Scanner;
    import java.util.Arrays;
    public class Test{
         static void printThis(String[] in){
              System.out.print("Value: ");
              for(int i = 0;i<in.length;i++){
                   System.out.print(in[i] + " ");
              System.out.println();
         static void reset(String[] val){
              for(int i = 0;i<val.length;i++){
                   val[i] = "";
         public static void main(String[] args){
              LinkedList<String[]> list = new LinkedList<String[]>();
              LinkedList<String> listTrans = new LinkedList<String>();
              System.out.print("Enter the number of records: ");
              Scanner s = new Scanner(System.in);
              int numOfRecords = s.nextInt();
              System.out.print("Enter the number of records per run: ");
              s = new Scanner(System.in);
              System.out.println();
              int numOfRecordsInMemory = s.nextInt();
              String[] getData = new String[numOfRecords];
              String[] transferData = new String[numOfRecordsInMemory];
              int numOfRuns = 0;
              int counter = 0;
              for(int i = 0;i<numOfRecords;i++){
                   counter++;
                   System.out.print("Enter value number " + counter + ": ");
                   Scanner scan = new Scanner(System.in);
                   getData[i] = scan.next();
                   listTrans.add(getData);
              if(getData.length%numOfRecordsInMemory == 0){
                   numOfRuns = getData.length/numOfRecordsInMemory;
              }else if(getData.length%numOfRecordsInMemory != 0){
                   numOfRuns =(int)(getData.length/numOfRecordsInMemory)+ 1;
              System.out.println();
              System.out.println("Number of Runs: " + numOfRuns);
         int pass = 0;
         System.out.println("Size of the main list: " + listTrans.size());
         while(listTrans.size() != 0){
              if(listTrans.size() >= numOfRecordsInMemory){
                   for(int i = 0;i<numOfRecordsInMemory;i++){
                        transferData[i] = listTrans.remove();
                   System.out.println("Size of the list: " + listTrans.size());
                   printThis(transferData);
                   System.out.println();
                   Arrays.sort(transferData);
                   list.add(transferData);
                   reset(transferData);
              }else if(listTrans.size() < numOfRecordsInMemory){
                   pass = listTrans.size();
                   for(int k = 0;k<pass;k++){
                        transferData[k] = listTrans.remove();
                   System.out.println("Size of the list: " + listTrans.size());
                   printThis(transferData);
                   System.out.println();
                   Arrays.sort(transferData);
                   list.add(transferData);
                   reset(transferData);
    //This is the part that is confusing me.
    //im trying to print it but its not working.
              System.out.println("Size of the next list: " + list.size());
    //          for(int i = 0;i<list.size();i++){
    //                    System.out.println();
    //               for(int j = 0;j<list.get(i)[j].length();j++){                    
    //                    System.out.print(list.get(i)[j] + " ");

    Here's the funnest, mabye clearest way you could do it: Use 2 Mappers
    package tjacobs.util;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import tjacobs.Arrays;
    public class Mapper <T>{
         public static interface MappedFunc<T> {
              void map(T value);
         public Mapper(T[] vals, MappedFunc<T> function) {
              this (new Arrays.ArrayIterator<T>(vals), function);
         public Mapper(Iterator<T> iterator, MappedFunc<T> function) {
              while (iterator.hasNext()) {
                   function.map(iterator.next());
         public static void main(String[] args) {
              String[] s = new String[] {"a","b", "c", "abc", "ab"};
              MappedFunc<String> func = new MappedFunc<String>() {
                   public void map(String s) {
                        if (s.toLowerCase().startsWith("a")) {
                             System.out.println(s);
              Mapper m = new Mapper(s, func);
    }

  • Urgent: how to print the contents displayed in JTextPane

    hi all,
    i've a problem printing the contents typed in styled format in JTextPane, when i print the contents nothing is printed. can anyone tell how can i print the contents typed in styled format or so. the code for implementing the print is given below.
    class ContentsArea extends JTextPane implements Pritable {
       public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
          if (pi >= 1) {
             return Printable.NO_SUCH_PAGE;
          Graphics2D g2d = (Graphics2D) g;
          g2d.translate(pf.getImageableX(), pf.getImageableY());
          g2d.translate(pf.getImageableWidth() / 2,
                          pf.getImageableHeight() / 2);
          Dimension d = getSize();
          double scale = Math.min(pf.getImageableWidth() / d.width,
                                    pf.getImageableHeight() / d.height);
          if (scale < 1.0) {
              g2d.scale(scale, scale);
          g2d.translate(-d.width / 2.0, -d.height / 2.0);
          return Printable.PAGE_EXISTS;
    }i'd be grateful to all ppl who helps me.
    Afroze.

    What's the exact problem? The printer printing a blank sheet or the printer not doing anything at all? First make sure in the main program you've got something along the lines of...
    import java.awt.print.*;
    PrinterJob printerJob = PrinterJob.getPrinterJob();
    PageFormat pageFormat = printerJob.defaultPage();
    if(!printerJob.printDialog()) return; //not essential but lets the user tweak printer setup
    pageFormat = printerJob.pageDialog(pageFormat); //ditto
    printerJob.setPrintable(this, pageFormat);
    print(...);
    The above code should go in an ActionListener, triggered when the user hits a print button or menuitem. I'm guessing you already have something similar set up.
    Then your print(...) method should be similar to
    public int print(Graphics g, PageFormat pageFormat, int pageIndex)
         if(pageIndex>0) return NO_SUCH_PAGE;
         Graphics2D gg = (Graphics2D)g;
         gg.draw(whatever's going to be printed);
         return PAGE_EXISTS;
    Which it is, although yours has clever scaling stuff built in ) The only thing you're not doing is rendering the actual content.
    So if you want the contents of the textpane, it'd make sense to use something like g.drawString(myTextPane.getContents()); in the print method. Note it's g and not g2d, since Graphics2D has more complicated text handling routines.
    I'm no expert tho )

Maybe you are looking for

  • How do i install itunes on ipad 2

    I have taken my new ipad 2 out of the box....no instructions...and that is as far as i have got...it is fully charged and i have the itune logo on front and that is it..i am completely lost

  • Changes in the user exit for VL01N dont reflect..

    Hello all,              I need a user-exit for restricting display ( and ultimately the delivery )of line-items while creating outbound delivery doc , depending on whether a particular line item is approved or not. I am currently using the user-exit

  • How can I compare single value with multiple value...

    Hello, I want to compare one value with multiple values, how can it possible ? Here in attachment I tried to design same logic but I got problem that when I entered value in y that is compared with only minimum value of x, I don't want that I want to

  • MOVEMENT TYPE 658

    hi, SAP GURU WHAT ARE THE STEPS FOR THE MOVEMENT TYPE 658(GOODS RETURN BLOCKED REVERSAL) PLZ ADVICE PREQUISITE STEPS. THANKS BHUSHAN

  • Placing VOID check on second page instead on first ....(Layout)

    Hi All, In Payables Manager responsibility there is a function called Payments formats in that particular screen we can give the number of invoices. The maximum we can give is 37. So every time when ever it is submitting the concurrent program it pri