Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    15
    Rep Power
    0

    Default Appending text to TextArea

    I have a DoublyLinkedList with displayforward() function which displays the content of my list onto the console. I am using objects to call the displayforward() function from a Router.java file. DoublyLinkedList is another class contained in a separate file. I use ObjectOutputStream inorder to receive the objects.

    How do i display the same content onto the TextArea of the Router front end?

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    TextArea.relpaceRange(String, int, int), TextArea.append(String), TextArea.insert(String, int) and/or new TextArea(String)
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Apr 2009
    Posts
    15
    Rep Power
    0

    Default

    InputStream is = socket.getInputStream();
    ObjectInputStream ois = new ObjectInputStream(is);

    Link pktrecv = (Link) ois.readObject();
    Link a=pktrecv;
    while(a!=null)
    {
    String disp="Encoded:"+a.en+"\nPacketNo:"+a.pktno+"\nSour ce:"+a.src+"\nDestination:"+a.dest+"\nData:"+a.dat a+"\nDistance:"+a.dist+"\n";
    a=a.next;
    jTextArea1.append(disp);
    }
    pktrecv.displayforward();


    pktrecv.displayforward() displays the object content in the console. How do i append the same to the TextArea? Is there a way to directly read from the inputstream and display like the above code?

  4. #4
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Does that code not do it?
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. How To add the Text field to the TextArea or TextPane
    By Chintan Patel in forum AWT / Swing
    Replies: 3
    Last Post: 04-08-2009, 02:46 AM
  2. Appending part XML to main XML
    By ank_k in forum New To Java
    Replies: 0
    Last Post: 11-13-2008, 05:23 AM
  3. Appending to ArrayList
    By eva in forum New To Java
    Replies: 2
    Last Post: 01-24-2008, 04:37 PM
  4. TextArea Bug?
    By Soda in forum New To Java
    Replies: 2
    Last Post: 12-07-2007, 12:37 PM
  5. Replies: 1
    Last Post: 08-07-2007, 05:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •