Results 1 to 5 of 5

Thread: How to use TextArea class?

  1. #1
    Join Date
    Jan 2010
    Posts
    79

    How to use TextArea class?

    Hi All,

    I am BSc(IT) student, and currently learning the java language. I am getting troubled while referring the TextArea class. I don't know anything about the methods and constructors of TextArea class of the java language. If you know anything about the TextArea class then please try to share it with me along with suitable example for the same. I would greatly appreciate your help.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to use TextArea class?

    Hi friend,

    A TextArea class object is a multi-line region that displays text. It can be set to allow editing or to be read-only. This java class is originally taken from the package known as 'java.awt.TextComponent'. This class implemenst four interfaces namely: Accessible, ImageObserver, MenuContainer, Serializable. The TextArea class of java basically extends the TextComponent.

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: How to use TextArea class?

    I suggest you to study following constructors of TextArea class:
    • TextArea(String txt, int rw, int clmn, int scrlbr)
    • TextArea(String txt, int rw, int clmn)
    • TextArea(String txt)
    • TextArea(int rw, int clmn)

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to use TextArea class?

    Hello friend,

    I hope something below code may help you to know about TextArea class:
    Code:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.TextArea;
    
    public class TextAreaDM extends Applet {
      TextArea display = new TextArea(1, 90);
      int paintCount1 = 0;
      String newline1;
      public void init() {
        display1 = new TextArea(1, 90);
        display1.setEditable(false);
         add(display1);
        newline1 = System.getProperty("line.separator");
        addItem("init: " + threadInfo(Thread.currentThread()));
      }
      public void start() {
        addItem("start: " + threadInfo(Thread.currentThread()));
      }
      public void stop() {
        addItem("stop: " + threadInfo(Thread.currentThread()));
      }
      public void destroy() {
        addItem("destroy: " + threadInfo(Thread.currentThread()));
       }
      String threadInfo(Thread t) {
        return "thread=" + t1.getName() + ", " + "thread group="
            + t1.getThreadGroup().getName();
      }
      public void update(Graphics g1) {
        addItem("update: " + threadInfo(Thread.currentThread()));
        super.update(g1);
      }
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: How to use TextArea class?

    Hi,

    Please refer following given some methods of the TextArea class:
    1. replaceText(String strg, int start, int end)
    2. replaceRange(String strg, int start, int end)
    3. preferredSize(int row1, int column1)
    4. minimumSize(int row1, int column1)
    5. insertText(String strg, int pos1)

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. what is textarea tag in html ?
    By Ramiroo in forum Software Development
    Replies: 3
    Last Post: 20-11-2009, 05:11 PM
  3. Ultra solid drives:Imation M-Class and S-Class
    By Regina in forum Portable Devices
    Replies: 1
    Last Post: 03-04-2009, 10:34 AM
  4. Problem with line in a textarea
    By CodGuru in forum Software Development
    Replies: 4
    Last Post: 23-03-2009, 11:24 AM
  5. Good news for CBSE CLASS X & CLASS IX - visit learnnext
    By surya_expert in forum Education Career and Job Discussions
    Replies: 0
    Last Post: 13-12-2008, 12:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,716,865,531.64152 seconds with 17 queries