🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15887

Re: calling repaint?

#15887
From: Tom Heagy
Date: Tue, 27 Apr 1999 00:00
25 lines
1347 bytes
The method "repaint" is non-static because it requires an actual
[instantiated] object to operate on.  An alternative would be to either make
the flipCard method non-static or pass the object being repainted as an
argument to "flipCard".

Olivares wrote:

> Hi
> I I'm proging a small net playable game and I need to call the repaint()
> method immediately  after calling a static function.
> the problem is when I try to call repaint a get an error: cannot run non
> static method in a static context.
>
> or something like that.
> is there any way I can get around this?
>
> ie:
> public static void flipCard()
> {    Code.....
>     Code....
>     repaint();
> }
>
> The game runs as an application not an applet.
> and im new at Java :)
Technical Details
Message-ID: <3725B554.8A28249E@sciatl.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7g3955$hle13@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,7d65a4f221c7a305
X-Google-Attributes: gidf74b3,public
From: Tom Heagy <tom.heagy@sciatl.com>
Subject: Re: calling repaint?
Date: 1999/04/27
Message-ID: <3725B554.8A28249E@sciatl.com>
X-Deja-AN: 471450880
Content-Transfer-Encoding: 7bit
References: <7g3955$hle13@forums.borland.com>
To: Olivares <olivar@idirect.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language