Printing out to a gui

Hi,
Can someone give me a hand with this??
for (int b = 0; b < a.length; b++)
          ta = new JTextArea(a);
this is going through my array of names and I want them to print out but when I run the program it keeps over writing the line and I end up with just the last name on the screen. Any ideas??
Thanks
DeeSheehan

Dude, come up with some more descriptive variable names, at least call the array names or something, not b
In every pass of the loop you create a new JTextArea and assign it to ta, thus overwriting what was there before. Of course you only end up with the last one after the loop.

Similar Messages

  • I hava a class that's print out in dos now I want it....

    I hava a class that's print out in dos now I want it to print out in a Gui application or applet instead how do I do.
    Here is the class file:
    import filenet.vw.api.*;
    public class QueueSample extends Object
    public QueueSample(VWSession vwSession, Logger logger, String queueName)
    QueueHelper queueHelper = null;
    VWQueue vwQueue = null;
    try
    logger.logAndDisplay("\n~ Starting QueueSample execution.");
    queueHelper = new QueueHelper(vwSession, logger);
    if (queueName != null)
    vwQueue = vwSession.getQueue(queueName);
    else
    String[] queueNames = queueHelper.getQueueNames(false);
    if (queueNames == null || queueNames.length == 0)
    logger.log("No queues found.");
    return;
    else
    // iteratively get queues until first one with available elements is found.
    for (int i = 0; i < queueNames.length; i++)
    vwQueue = vwSession.getQueue(queueNames);
    if (vwQueue != null)
    if (vwQueue.fetchCount() > 0)
    break;
    // clear our reference
    vwQueue = null;
    if (vwQueue == null)
    logger.log("Unable to retrieve a queue!");
    return;
    else
    // display the contents of the queue
    queueHelper.displayQueueContents(vwQueue);
    catch (Exception ex)
    if (logger != null)
    logger.log(ex);
    else
    ex.printStackTrace();
    finally
    if (logger != null)
    logger.logAndDisplay("~ QueueSample execution complete.\n");
              //{{INIT_CONTROLS
    public static void main(String args[])
    String queueName = null;
    String fileName = null;
    Logger logger = null;
    SessionHelper sessionHelper = null;
    VWSession vwSession = null;
    QueueSample sampleClass = null;
    try
    // did the user supply enough arguments?
    if (args.length < 3 || (args.length > 0 && args[0].compareTo("?") == 0))
    System.out.println("Usage: QueueSample username password router_URL [queue_name] [output_file]");
    System.exit(1);
    // the queue name is optional
    if (args.length > 3)
    queueName = args[3];
    // the file name (for output) is optional
    if (args.length > 4)
    fileName = args[4];
    else
    fileName = new String("QueueSample.out");
    // create and initialize the logger
    logger = new Logger(fileName);
    // create the session and log in
    sessionHelper = new SessionHelper(args[0], args[1], args[2], logger);
    vwSession = sessionHelper.logon();
    if (vwSession != null)
    // create the sample class
    sampleClass = new QueueSample(vwSession, logger, queueName);
    catch (Exception ex)
    if (logger != null)
    logger.log(ex);
    else
    ex.printStackTrace();
    finally
    // logoff
    if (sessionHelper != null)
    sessionHelper.logoff();
    //Newbie

    I might sound stupid now but as far as I can gather you have a class that prints your exceptons out to dos. You would like to apply this class in an Application /Applet so that YOu can print out to a screen that you have designed. If that is the case just instantiate and intialize that class to the Application / Applet where you would like to display it. What is so difficult?
    getYourLabel/textarea.setText("Info that you wanted printed in gui / applet");
    //Don't use System.out.println('"...");Also another thing if it is what I suspect then you have to go and study your theory again.

  • How can I print out an Array List in my GUI program?

    I have an ArrayList of Objects which I want to print out in a TextArea in my GUI. I tried using setText(), but it seems like that can only handle strings. Does anyone know of an alternative method or some other way to get around this?

    Ok, I have an object name Instrument which contains a double price, String name, int numberInStock. In my GUIFrame class which creates the GUI obviously, I have a button listener that should print out my ArrayList in a TextArea when clicked on a button.
    Here is the code:
    private class showIResponse implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   showText.setText(parseString(ali));
    it is still giving me an error saying "cannot find symbol method parseString(java.util.ArrayList<java.lang.Object>)"

  • Cannot read list of frontend printers - Printing in SAP JAVA GUI for MAC

    Hello,
    I am trying to print a Spool request in SAP Java GUI 7.10. I am working on Apple with OSX operating system. I get this error message -
    " Cannot read list of frontend printers " - Message no. PO781
    What do i need to do to take a print out from SAP on my Mac.
    Thanks
    Buddy

    Hello,
    which printing access method you are using?
    You might want to have a look at [note 821519|https://service.sap.com/sap/support/notes/821519].
    Best regards
    Rolf-Martin

  • How can I print out the file directory?

    Years ago, I could print out a list of files in a folder from the finder window. Is there now a workaround utility to do that? I don't want to use screen shots, as the directory is too long and would require several screen shots.  thx.

    http://hints.macworld.com/article.php?story=20060720174103802
    or
    http://reviews.cnet.com/8301-13727_7-20026446-263.html

  • How can I print out the graph I need only, without the controls and indicators?

    I'm doing some programming in LABVIEW. I need to print out only the graph, without the buttons, controls, indicators. I tried to look for such a function in LABVIEW, but in vain. How can I achieve the result I expect in my programming?

    Hi Fenny,
    you should use the report generation functions to create a report containing your graph image and print it.
    Take a look at the Sample Test Report.vi you find in the report examples of LV.
    Just look at the part of the diagram where it is used Append Control Image to report.vi (in the center of the report functions chain); a graph reference is wired to the Ctrl reference input ( to create a reference of your graph right click on it and select create reference).
    Let me know if you need more help,
    Alberto

  • How can I print out the contents of my hardrive

    I have a hardrive with about 200 video clips and need to print the titles for cross refrerencing. I was just going to "grab" screenshots but this will take about ten sheets of paper. How can I print out a list of all the files on the drive?

    I tried this Finder drag method & discovered that it is very important to set the blank TextEdit document to plain text before the drag (from the format menu or with Cmd-shift-t). If you don't, TextEdit attempts to load the content of the files!
    Once I discovered this, I tried the method with Find (Cmd-F) results & it works for that, too. This means that by choosing the right combination of search location(s) & search criteria, you can extend the method to filter the list to just about any files you want, which could be very handy.
    For instance, set the "Kind" criteria to "QuickTime Movie" & location to "Computer" & you get a list of every QT movie. Or set the search location to the folder containing the movies of interest & you get all of them, including ones in subfolders. You could also use the 'date created' or other search criteria to filter the list to a specific subset of movies (or whatever).
    If you need to do this often, you could create one or more 'Smart Folders' with the criteria preloaded for each search.
    The only drawback I see for either Finder based method is the full path one. If you are getting results from just one or a few folders, Find & Replace can delete any of the path name fairly easily, but it becomes a chore if there are a lot of different ones. Some other text editor, like TexEdit Pro, that supports grep searches would be handy here, but since I'm not up to speed on grep, someone else will have to explain how to use it for this, if they want.

  • How can i print out the waveform chart?

      hello everybody,
    how can i print out the "waveform chart". can i do it just push the button. ( example; stop button is stop the program etc..)
    i checked the NI examples but i can't understand. i'm new to the Labview.
    pls help me.
    i added the my program
    look forward your reply
    regards from turkey...
    Message Edited by hknmkt on 05-29-2008 04:15 AM
    Attachments:
    29.05.2008_11.vi ‏37 KB

        hi jim,
    i tried the program but it's not running. When i run the program, it's print out without run the program
    i added the printed file.
    look forward your reply
    hakan
    Attachments:
    error8.JPG ‏8 KB

  • PO print out of delivery schedule

    Hi,
    Suppose I am generating a PO , in some cases I will be giving delivery schedule for some items in item details.
    I want this to come in the print out.
    But its not coming .
    Please advise.
    regards,

    Hi
    You can include logic with the help of Developre, If information is there in EKET for Purchase order ask him to include in print.
    regards
    Srinivas

  • How to print out wallet size photos on 6510 e-all-in-one series photosmart printer

    want to print out wallet size photos (size 3 and a half x 2 and a half).  I have windows XP and my printer is the photosmart 6510 e-all-in-one series

    You will have to change the settings in the photo editing software and put 2 wallets on a 4x6 or 9 wallets on a full page.  The photo tray will not take paper smaller than 4x6.
    SandyBob
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP
    1-800-474-6836

  • Freezing when trying to print out PDF?

    Trying to print out PDF of Aperture 'book'. Each time it freezes on the same page ... this particular page is where I have one image stretched across two pages. Is this possibly a glitch with Aperture?
    Ben
    I've trashed my preferences several times; doesn't seem to help. I've also tried to use two copies of the same picture (right half on right page, left half on left page); but that doesn't work too well, as Aperture seems to want to favor one side or the other – and thus I can't adjust the two sides to match up properly.
    Any suggestions would be most appreciated, thank you,
    Ben

    Hi Allen,
    I'm all topped up, big graphics card, latest ver. of Tiger, permissions repaired every day or so. The mystery continues.
    I love the IDEA of the two page spread. Have longed for it in Pages, where I'm producing a whole series of books ... a lot of two page spreads (but done by using two versions of the same still).
    Thanks,
    Ben

  • New Ink Cartridge but can not print out/copy any document.

    I have HP Printer Deskjet 1050. I've just bought 1 x Original HP Ink Cartridge Colour Black No.61 that can be used as well for my HP Deskjet 1050 (because I could't get No.802 Black Cartridge). I have pulled out the empty one and pushed the new one in until I heard snap sound (I've followed as what is in the instruction poster). Before my old Ink was empty, I was able to print either black or colour. Now, after I've got new one pushed in, I couldn't print nothing, even the alignment page doesn't automatically print out after all cartridges are pushed in and cartridge door was closed. My Black Ink warning light is blinking all the time. I can scan to my computer/laptop but can not print it out or make copy from the printer. This printer is not compatible for my laptop with OS Windows 8.1 (64-bit), but I was able to use my printer for printing thru my laptop by using HP AiO Printer Remote. Please help?

    Hi @KroebY, 
    Welcome to the HP support Forums! I see you have replaced the black cartridge on your HP Deskjet 1010, but it is not registering the new cartridge. You are unable to copy or print, you can make a scan. I notice you said your DJ 1010 was not compatible with the Windows 8.1 Operating system, there are full feature software and drivers available for your printer.
    Let's start troubleshooting the print quality issues: Printer Prints a Blank Page or Does Not Print Black or Color Ink for the HP Deskjet Ink Advantage an...
    Does this help, are you now able to print and make a copy? If yes, continue below:
    Now, the software:
    1. Unplug the USB if using a direct connection.
    2. Remove the HP DJ 1010 software from your computers Control Panel's Uninstall a program option.
    3. Restart the computer.
    4. Make sure all the DJ 1010 software is gone from the programs list as well as your HP folder listed under the All programs in your Start Menu.
    5. Now go ahead and download the software and drivers for your DJ 1010 (DO NOT plug in USB until the software prompts you to):
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=dj-117518-4&cc=us&dlc=en&lc=en...
    6. Go ahead and print a test page.
    7. If you are unable to print a test page, please run the HP Print and Scan Doctor- It was designed by HP to provide users with the troubleshooting and problem solving features needed to resolve many common problems experienced with HP print and scan products connected to Windows-based computers.
    Please let me know if you are not able to print, and if the installation was successful.  I will watch for your reply.
    Thank you,
    HevnLgh
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • Print out in MB90 for GRN is not coming in English

    Dear Friends,
    While taking the print out in MB90 for GRN document, it is not coming in English.It is coming in some unreadableformat.
    In MN21 I have mentioned the language as EN.
    In the configuration of output type WE03 I have mentioned the language as EN intransaction code M706.
    A reply will be highly appreaciated.
    Regards
    Rutabhadra Panda

    hi
    check whether the printer you installed is having the proper driver.

  • Material price is not coming in PO print out

    Hi
    I am facing a problem for a cost cenetr PO material price is not coming in print preview as welll as in print out for a particular PO  what can be the problem.
    regards,
    zafar

    Solution in this link Print priview of Purchase Order

  • How t print out selected values from a Jlist

    hi iam trying to get the selected values from a list to print out as a string but iam getting ,Invalid cast from java.lang.Object[] to java.lang.String.is there any way to get the selected values t print ut as a string?? import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MultipleSelection2 extends JFrame {
    private JList colorList, copyList;
    private JButton copy;
    private String colorNames[] =
    { "Black", "Blue", "Cyan", "Dark Gray", "Gray",
    "Green", "Light Gray", "Magenta", "Orange", "Pink",
    "Red", "White", "Yellow" };
    public MultipleSelection2()
    super( "Multiple Selection Lists" );
    Container c = getContentPane();
    c.setLayout( new FlowLayout() );
    colorList = new JList( colorNames );
    colorList.setVisibleRowCount( 5 );
    colorList.setFixedCellHeight( 15 );
    colorList.setSelectionMode(
    ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
    c.add( new JScrollPane( colorList ) );
    // create copy button
    copy = new JButton( "Copy >>>" );
    copy.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e )
    // place selected values in copyList
    copyList.setListData(
    colorList.getSelectedValues());
    String s1 =(String)colorList.getSelectedValues();

    Since the JList method 'getSelectedValues' returns an object array you'll need to iterate through the array and cast each object in the array to a string as you access them.
    Object[] o = colorList.getSelectedValues();
    for(int count=0,end=o.length; count<end; count++) {
    String s = (String) o[count];
    Hope that helps
    Talden

Maybe you are looking for

  • How do i get ipad games to a vizio tablet

    how do i get ipad 2 gamesto my vizio tablet i sent $35 on a micro sdcard to transfer the games but it dosent fit in the ipad so i tried geting it off my mac book but it wont leave the ipad files. so what do i do

  • Add a link to a button

    Hi Guys, I am having problems trying to add a link to a button and it doesn't work. I converted a graphic to button and added the link to the button and when I tested the page show up as a blank page. Please help..I haven't touched Flash like 10 year

  • Time Stamp via Custom Function

    This is such a basic concept for a custom function that I am assuming someone out there has done it already. I have never created a custom function for Essbase, though I have programmed in a variety of languages and I'm assuming getting the current d

  • How to use console font in terminal

    i love console font and color in the way it appears. there are some thread but it's not actually a solutions. https://bbs.archlinux.org/viewtopic.php?id=138811 https://bbs.archlinux.org/viewtopic.php?id=77522 is it possble to convert bitmap font to t

  • How to define new Navigation Link in IC wed

    Hi, while creating the navigation bar id, we have to give atleast one of the following inputs 1 Navigation Link or 2.Class Name or 3.Launch Transaction ID I know how to create launch transaction id,but i found that the out put of the trasaction is in