Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4039177

TextArea has a size limitation on Win32??

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1, 1.1.5
    • client-libs
    • None
    • x86
    • windows_95

      Name: sgC58550 Date: 03/14/97


      To repeat the problem, run the applet and hit the SEND button several
      times to start many threads. We have seen it lock up when the SEND
      button was hit only once (i.e. 2 new threads) but it happens much faster
      when the SEND button is hit several times.

      import java.applet.*;
      import java.awt.*;

      public class AppletClient extends Applet
      {
      static Frame f = new Frame();
      static TextArea ta = new TextArea(5, 75);

      public void init()
      {
        setLayout(new BorderLayout());
        add("North", new Button("SEND"));
        f.setLayout(new BorderLayout());
        f.add("Center", ta);
        f.resize(300, 400);
        f.setBackground(Color.green);
        f.show();
      }

      public boolean action(Event evt, Object arg)
      {
        if (arg.equals("SEND"))
        {
          Displayer ac1 = new Displayer("Argentina", this);
          Displayer ac2 = new Displayer("Ethiopia", this);
          ac1.start();
          ac2.start();

        }
        else return super.action(evt, arg);
        return true;

      }
              public synchronized void DisplayResults(String name, Thread t)
      // public void DisplayResults(String name, Thread t)
              {
                      for (int i=1; i <= 5; i++)
              {
                      ta.appendText("i="+i+" "+name+" "+t.toString() +"\n");
                              t.yield();
              }
              }
      }

      class Displayer extends Thread
      {
              private String name;
              AppletClient a;

              public Displayer(String n, AppletClient caller)
              {
              name = n;
              a = caller;
              }

              public void run()
              {
                      for (;;) {
                              a.DisplayResults(name, this);
                              try { sleep(2000); } catch (InterruptedException e) {}
                      }
              }
      }
      --

      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: