Article View: borland.public.jbuilder.java.api
Article #3409Re: BUG: setXORMode()
From: John Seitz
Date: Mon, 05 Jan 1998 00:00
Date: Mon, 05 Jan 1998 00:00
91 lines
3005 bytes
3005 bytes
This is a multi-part message in MIME format.
--------------7BE98B3C0F41F86D8A2850C8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I am also having a problem with XOR drawing. I'm trying to draw a line
that will follow the mouse pointer while the mouse is being draged. The
line does follow the mouse, but it leaves a trail of yellow dots where
the mouse has been. I can't figure this out. Am I doing something
wrong or is it JDK?
John
========================= CODE ==================================
void bevelPanel1_mousePressed(MouseEvent e)
{
startX = endX = e.getX();
startY = endY = e.getY();
}
void bevelPanel1_mouseReleased(MouseEvent e)
{
endX = e.getX();
endY = e.getY();
Graphics g = e.getComponent().getGraphics();
g.setXORMode( Color.yellow);
g.drawLine(startX, startY, endX, endY );
}
void bevelPanel1_mouseDragged(MouseEvent e)
{
Graphics g = e.getComponent().getGraphics();
// setup the drawing stuff
g.setXORMode(Color.yellow);
// first draw last line
g.drawLine(startX, startY, endX, endY );
// update the line coordinates
endX = e.getX();
endY = e.getY();
// draw new line
g.drawLine(startX, startY, endX, endY );
}
========================= CODE ==================================
Manfred Grebler wrote:
> This seems to be a bug in JBuilder. The following code works
> as expected in JDK and Communicator. JBuilder however always
> draws in white. (Background color ist white, too.)
>
> g.setXORMode(Color.white);
> g.setColor(Color.black);
> if (oldrect!=null)
> g.drawRect(oldrect.x, oldrect.y, oldrect.width, oldrect.height);
> g.drawRect(rect.x, rect.y, rect.width, rect.height);
>
> --
> Manfred Grebler
> iXOS Software AG - Product Development
> Bretonischer Ring 12
> D-85630 Grasbrunn
> Germany
>
> Phone: +49 89 46005-340
> E-Mail: manfred.grebler@ixos.de
--------------7BE98B3C0F41F86D8A2850C8
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Seitz, John
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: John Seitz
n: Seitz;John
email;internet: seitz@pobox.com
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------7BE98B3C0F41F86D8A2850C8--
Technical Details
Message-ID:
<34B1A712.C8AD2F34@pobox.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<348D2629.5072@privat.post.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,214db217c8e2c65b X-Google-Attributes: gid1089d0,public From: John Seitz <seitz@pobox.com> Subject: Re: BUG: setXORMode() Date: 1998/01/05 Message-ID: <34B1A712.C8AD2F34@pobox.com> X-Deja-AN: 313179681 References: <348D2629.5072@privat.post.de> Content-Type: multipart/mixed; boundary="------------7BE98B3C0F41F86D8A2850C8" Organization: None Mime-Version: 1.0 Reply-To: seitz@pobox.com Newsgroups: borland.public.jbuilder.java.api