For Programmers: Free Programming Magazines  


Home > Archive > Java Help > August 2005 > Must be simple - window does not redraw when uncovered









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Must be simple - window does not redraw when uncovered
David Aldred

2005-07-30, 9:01 am


Newbie question.... must be a simple answer to this!

I'm writing an essentially simple Java application (based on awt and
extending Frame, not a browser applet). It relies on graphics calls like
drawString and drawLine to set up a grid of numbers.

When it's running, if any other application comes to the foreground and
covers my application window, when that 'foreground' application goes away
again, my application doesn't redraw the grid - I'm just left with a blank
window (or partially blank if the other window didn't completely cover it).

I thought that explicitly redrawing everything on a windowActivated method
would sort this out, but it doesn't.

Where should I start?

--
David Aldred
David Aldred

2005-08-17, 9:16 am

Ian Shef wrote:

> You should be doing your drawing by overriding the method
> public void paint(Graphics g)
>
> probably in your extension of Frame.
>


Thanks, that sorted it.

Sorry about the delay - been AFK.

--
David Aldred
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com