🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1436

How do I get the paint Rectangle in paintComponent()

#1436
From: Bill Darbie
Date: Wed, 19 Nov 2003 01:42
23 lines
1898 bytes
Help!  I have been stuck on this problem for hours.

How do I get the Rectangle of the original repaint() call
in a components paintComponent(Graphics graphics) method?

For example.  Say a repaint(0, 0, 10, 10) is called somewhere
in the code.

Say my JComponent has a bounds of Rectangle(9, 9, 5, 5)

In the components paintComponent(Graphics graphics) method
I can call:
graphics.getClipBounds() and that will return (0, 0, 1, 1)
Basically it returns the intersection of the original repaint rectangle (0,
0, 10, 10)
and my bounds (9, 9, 5, 5) relative to my components coordinates, which
gives 0, 0, 1 1.

But I want a way to get the 0,0,10,10 rectangle from the paintComponent
method.  Is there a way to do this?

Thanks,
Bill
Technical Details
Message-ID: <1069206098.357352@cswreg.cos.agilent.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,f24930dae02d93a3,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-11-18 18:09:26 PST
From: "Bill Darbie" <noSpam@noSpam.com>
Newsgroups: borland.public.jbuilder.java.swing
Subject: How do I get the paint Rectangle in paintComponent()
Date: Tue, 18 Nov 2003 18:42:38 -0700
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Organization: Agilent Technologies
Message-ID: <1069206098.357352@cswreg.cos.agilent.com>
Cache-Post-Path: cswreg.cos.agilent.com!unknown@mtddarbi.lvld.agilent.com
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
Cache-Post-Path: cswrelay.cos.agilent.com!unknown@cswreg.cos.agilent.com
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
NNTP-Posting-Host: 192.6.143.83
X-Trace: newsgroups.borland.com 1069206097 192.6.143.83 (18 Nov 2003 17:41:37 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail