[5012] in java-interest
Re: Attempt at drawing movable rectangle
daemon@ATHENA.MIT.EDU (Jim Graham)
Thu Jan 25 21:14:14 1996
Date: Thu, 25 Jan 1996 16:40:54 -0800
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
To: java-interest@java.Eng.Sun.COM, kimberl1@gramercy.ios.com
Hi Jay,
> (1) The code doesn't even display the rectangle! What am I doing wrong?
> (The code is listed at the end of this message.)
> (2) Am I implementing this correctly? Is this the best way to write this,
> or should I be using panels or some of the more advanced elements in the
> AWT?
The problem is that you are overriding the wrong method:
> public void print(Graphics g) {
> g.drawRect(x, y, width, height);
> }
Change the name of this method to "paint" and it should work much better...
...jim
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com