Article View: comp.lang.java.gui
Article #27update method never called and repaint question ?
From: bruno nogent
Date: Mon, 29 Apr 2002 17:22
Date: Mon, 29 Apr 2002 17:22
23 lines
1899 bytes
1899 bytes
With this code, the update method is not called !!!
Why ?
How modify this code to repaint only the piece of the screen changed with a
double buffer ?
public void mouseMoved(MouseEvent event) {
x = event.getX();
y = event.getY();
repaint();
}
private int x = 0, y = 0;
public void paint(Graphics g) {
g.setColor(Color.green);
g.fillRect(x, y, 50, 50);
}
public void update(Graphics screen) {
System.out.println(++cpt);
paint(screen);
}
Technical Details
Message-ID:
<aajs6b$vge$1@s1.read.news.oleane.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!oleane.net!oleane!nnrp.oleane.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,811949753321204a,start X-Google-Attributes: gid111d45,public X-Google-Thread: 10a146,811949753321204a,start X-Google-Attributes: gid10a146,public X-Google-Thread: 113ae9,811949753321204a,start X-Google-Attributes: gid113ae9,public X-Google-Thread: 10fd6d,811949753321204a,start X-Google-Attributes: gid10fd6d,public X-Google-ArrivalTime: 2002-04-29 09:30:04 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "bruno nogent" <bnogent@club-internet.fr> Newsgroups: comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer,borland.public.jbuilder.java.swing Subject: update method never called and repaint question ? Date: Mon, 29 Apr 2002 18:22:51 +0100 Organization: Guest of France Telecom Oleane's newsreading service Lines: 31 Message-ID: <aajs6b$vge$1@s1.read.news.oleane.net> NNTP-Posting-Host: 217.167.155.90 X-Trace: s1.read.news.oleane.net 1020097547 32270 217.167.155.90 (29 Apr 2002 16:25:47 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 29 Apr 2002 16:25:47 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200