Received: from PACIFIC-CARRIER-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA20362; Thu, 22 Feb 96 02:12:14 EST
Received: from liquor.cabi.net by MIT.EDU with SMTP
	id AA20865; Thu, 22 Feb 96 02:11:53 EST
Received: by liquor.cabi.net (8.7.3/8.7.3) id XAA02570; Wed, 21 Feb 1996 23:00:49 -0500
Resent-Date: Wed, 21 Feb 1996 23:00:49 -0500
Sender: barn@CrashCup.mcs.net
Message-Id: <312BE9D3.682A8363@mcs.com>
Date: Wed, 21 Feb 1996 21:58:11 -0600
From: CrashCup <barn@mcs.com>
X-Mailer: Mozilla 2.0 (X11; I; Linux 1.3.66 i586)
Mime-Version: 1.0
To: java-linux@java.blackdown.org
Subject: repaint() problem
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"mZYP51.0.rc.yd-An"@liquor>
Resent-From: java-linux@java.blackdown.org
X-Mailing-List: <java-linux@java.blackdown.org> archive/latest/1213
X-Loop: java-linux@java.blackdown.org
Precedence: list
Resent-Sender: java-linux-request@java.blackdown.org

I try the below application and it seems that paint() is only called
twice (once at the beginning and once at the end of program. I thought
repaint() called udpdate(). I've tried a similar test on Aix and it
works. (i am doing the linux code from memory and I could be dropping
neurons). Excuse the code I was having trouble with the Aix java and 
wanted to test against Linux java, but I can't seem to update().

import java.awt.*;
import java.util.*;
import java.io.*;


class TestFrame extends Frame
{
  int dx, dy, dw, dh;
  Color color;

  public TestFrame()
    {
     super("Graphics Test");
     dx = 0;
     dy = 0;
     dw = 35;
     dh = 35;
     color = Color.blue;
     resize(350,350);
    }

  public void paint(Graphics g)
   {
    update(g);
   }

  public void update(Graphics g)
   {
    System.out.print("update() called...\n");
    g.setColor(color);
    g.fillRect(dx, dy, dw, dh);
   }

  public void draw(int x, int y, int w, int h, Color clr)
    {
     dx = x;
     dy = y;
     dw = w;
     dh = h;
     color = clr;
     repaint();
    }
}


class Test
{
 public static void main(String args[])
   {
    int dly, offset = 10;
    TestFrame  tf;

    tf = new TestFrame();
    show();
    dly = 0;
    do
      {
       for(offset = 10;offset < 300;offset++)
         {
          tf.draw(offset + 10, offset + 10, 20, 30, Color.red);
         }
      }while(dly++ < 10);
    }
}

Anyone see if I screwed something up?

Barney

